mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 09:38:32 +01:00
55 lines
873 B
PHP
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,
|
|
],
|
|
];
|
|
}
|
|
}
|