mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-01 02:18:40 +00:00
Extend permutation test for other return
This commit is contained in:
parent
efb6421289
commit
5bfba4b202
|
|
@ -21,10 +21,12 @@ class PermutationTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
public function testPermute()
|
public function testPermute()
|
||||||
{
|
{
|
||||||
$arr = ['a', 'b', 'c'];
|
$arr = ['a', 'b', 'c'];
|
||||||
$permutations = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'];
|
$permutations = ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'];
|
||||||
|
$permutations2 = [['a', 'b', 'c'], ['a', 'c', 'b'], ['b', 'a', 'c'], ['b', 'c', 'a'], ['c', 'a', 'b'], ['c', 'b', 'a']];
|
||||||
|
|
||||||
self::assertEquals($permutations, Permutation::permut($arr));
|
self::assertEquals($permutations, Permutation::permut($arr));
|
||||||
|
self::assertEquals($permutations2, Permutation::permut($arr, [], false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIsPermutation()
|
public function testIsPermutation()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user