mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-10 07:34:00 +08:00
40 lines
883 B
PHP
Executable File
40 lines
883 B
PHP
Executable File
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use service\Utility\Helper;
|
|
|
|
class GetUniqueItemListTest extends TestCase {
|
|
public function testGetUniqueItemList()
|
|
{
|
|
$expected = [
|
|
[
|
|
'key' => 'value1',
|
|
'otherKey' => 'otherValue'
|
|
],
|
|
[
|
|
'key' => 'value2',
|
|
'otherKey' => 'otherValue'
|
|
]
|
|
];
|
|
|
|
$actual = [
|
|
[
|
|
'key' => 'value1',
|
|
'otherKey' => 'otherValue'
|
|
],
|
|
[
|
|
'key' => 'value1',
|
|
'otherKey' => 'otherValue'
|
|
],
|
|
[
|
|
'key' => 'value2',
|
|
'otherKey' => 'otherValue'
|
|
]
|
|
];
|
|
|
|
$actual = Helper::getUniqueItemList($actual, 'key');
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
}
|
|
}
|