mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 17:56:09 +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],
|
|
];
|
|
}
|
|
}
|