endtoend-test-psl/tests/Psl/Arr/CountTest.php

28 lines
509 B
PHP
Raw Normal View History

2020-08-25 02:17:33 +02:00
<?php
declare(strict_types=1);
namespace Psl\Tests\Arr;
use PHPUnit\Framework\TestCase;
use Psl\Arr;
final class CountTest extends TestCase
2020-08-25 02:17:33 +02:00
{
/**
* @dataProvider provideData
*/
public function testCount(int $expected, array $array): void
{
static::assertSame($expected, Arr\count($array));
}
public function provideData(): iterable
{
yield [0, []];
yield [2, [1, 2]];
yield [1, [null]];
yield [4, [null, null, false, 0]];
}
}