2019-12-24 01:52:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Psl\Tests\Arr;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-12-25 00:35:14 +01:00
|
|
|
use Psl\Arr;
|
2019-12-24 01:52:07 +01:00
|
|
|
|
|
|
|
class IsArrayTest extends TestCase
|
|
|
|
{
|
2019-12-25 00:35:14 +01:00
|
|
|
/**
|
|
|
|
* @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,
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
2019-12-24 01:52:07 +01:00
|
|
|
}
|