endtoend-test-psl/tests/Psl/SequenceTest.php
2020-07-07 14:17:36 +01:00

28 lines
519 B
PHP

<?php
declare(strict_types=1);
namespace Psl\Tests;
use PHPUnit\Framework\TestCase;
use Psl;
class SequenceTest extends TestCase
{
/**
* @dataProvider provideData
*/
public function testSequence(array $args, $expected): void
{
$this->assertSame($expected, Psl\sequence(...$args));
}
public function provideData(): iterable
{
yield [[], null];
yield [[null], null];
yield [[1, 2, 3], 3];
yield [['foo', 'bar', 'baz', 'qux'], 'qux'];
}
}