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