endtoend-test-psl/tests/Psl/Arr/IsArrayTest.php
2019-12-25 19:46:58 +01:00

55 lines
873 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests\Arr;
use PHPUnit\Framework\TestCase;
use Psl\Arr;
class IsArrayTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testIsArray(bool $expected, $value): void
{
static::assertSame($expected, Arr\is_array($value));
}
public function provideData(): array
{
return [
[
false,
'foo',
],
[
true,
[],
],
[
false,
(fn () => yield 5)(),
],
[
false,
4,
],
[
false,
false,
],
[
false,
STDOUT,
],
];
}
}