/** * @dataProvider simpleArrayProvider */ public function testSortKeysDesc(array $array) { $ma = new ImmutableArray($array); $copiedMa = $ma->sortKeys(SORT_DESC, SORT_REGULAR); krsort($array, SORT_REGULAR); $this->assertTrue($copiedMa !== $ma); $this->assertTrue($array === $copiedMa->toArray()); }
/** * @dataProvider simpleArrayProvider * * @param array $array */ public function testSortKeysDesc(array $array) { $arrayzy = new A($array); $resultArrayzy = $arrayzy->sortKeys(SORT_DESC, SORT_REGULAR); $resultArray = $array; krsort($resultArray, SORT_REGULAR); $this->assertImmutable($arrayzy, $resultArrayzy, $array, $resultArray); }