mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-11 16:49:40 +01:00
43 lines
859 B
PHP
43 lines
859 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Arr;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Arr;
|
|
use Psl\Collection;
|
|
|
|
class ConcatTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider provideData
|
|
*/
|
|
public function testConcat(array $expected, array $first, array ...$other): void
|
|
{
|
|
static::assertSame($expected, Arr\concat($first, ...$other));
|
|
}
|
|
|
|
public function provideData(): array
|
|
{
|
|
return [
|
|
[
|
|
['a', 'b', 'c'],
|
|
['foo' => 'a'],
|
|
['bar' => 'b'],
|
|
['baz' => 'c'],
|
|
],
|
|
[
|
|
['foo', 'bar', 'baz', 'qux'],
|
|
['foo'],
|
|
['bar'],
|
|
['baz', 'qux'],
|
|
],
|
|
[
|
|
[1, 2, 3],
|
|
[1, 2, 3],
|
|
],
|
|
];
|
|
}
|
|
}
|