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

32 lines
601 B
PHP
Raw Normal View History

2019-12-24 01:52:07 +01:00
<?php
declare(strict_types=1);
namespace Psl\Tests\Arr;
use PHPUnit\Framework\TestCase;
2019-12-25 00:35:14 +01:00
use Psl\Arr;
2019-12-24 01:52:07 +01:00
use function array_values;
final class ValuesTest extends TestCase
2019-12-24 01:52:07 +01:00
{
2019-12-25 00:35:14 +01:00
public function testValues(): void
{
$array = [
'foo' => 'bar',
'bar' => 'baz',
'baz' => 'qux',
];
$values = Arr\values($array);
static::assertSameSize($values, $array);
static::assertSame($values, array_values($array));
2019-12-25 00:35:14 +01:00
foreach ($array as $value) {
static::assertTrue(Arr\contains($values, $value));
2019-12-25 00:35:14 +01:00
}
}
2019-12-24 01:52:07 +01:00
}