mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-02 17:56:09 +01:00
31 lines
644 B
PHP
31 lines
644 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Iter;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Iter;
|
|
|
|
final class IsEmptyTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testIsEmpty(bool $expected, iterable $iterable): void
|
|
{
|
|
static::assertSame($expected, Iter\is_empty($iterable));
|
|
}
|
|
|
|
public function provideData(): iterable
|
|
{
|
|
yield [true, []];
|
|
yield [true, Iter\from_entries([])];
|
|
yield [true, (static fn () => yield from [])()];
|
|
|
|
yield [false, [null]];
|
|
yield [false, [false]];
|
|
yield [false, ['hello', 'world']];
|
|
}
|
|
}
|