endtoend-test-psl/tests/Psl/Dict/FromEntriesTest.php

30 lines
589 B
PHP
Raw Normal View History

2021-02-16 00:23:01 +01:00
<?php
declare(strict_types=1);
namespace Psl\Tests\Dict;
use PHPUnit\Framework\TestCase;
use Psl\Dict;
final class FromEntriesTest extends TestCase
{
public function testEmptyEntries(): void
{
$actual = Dict\from_entries([]);
static::assertCount(0, $actual);
}
public function testFromEntries(): void
{
$array = Dict\from_entries([
[1, 'hello'],
[2, 'world']
]);
static::assertCount(2, $array);
static::assertSame('hello', $array[1]);
static::assertSame('world', $array[2]);
}
}