mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-11 16:49:40 +01:00
29 lines
546 B
PHP
29 lines
546 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Arr;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Arr;
|
|
|
|
final class ContainsKeyTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testContainsKey(bool $expected, array $array, $key): void
|
|
{
|
|
static::assertSame($expected, Arr\contains_key($array, $key));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
[false, [], 5],
|
|
[true, ['foo' => null], 'foo'],
|
|
[true, [1], 0],
|
|
];
|
|
}
|
|
}
|