Extend permutation test for other return

This commit is contained in:
Dennis Eichhorn 2018-09-12 21:36:19 +02:00
parent efb6421289
commit 5bfba4b202

View File

@ -23,8 +23,10 @@ class PermutationTest extends \PHPUnit\Framework\TestCase
{ {
$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()