mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-12 17:17:25 +01:00
29 lines
540 B
PHP
29 lines
540 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Arr;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Arr;
|
|
|
|
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],
|
|
];
|
|
}
|
|
}
|