public function testCombineWith() { $firstArray = [1 => 'one', 2 => 'two', 3 => 'three']; $secondArray = ['one' => 1, 1 => 'one', 2 => 2]; $combinedArray = array_combine($firstArray, $secondArray); $ma = new MutableArray($firstArray); $copiedMa = $ma->combineWith($secondArray); $this->assertTrue($copiedMa === $ma); $this->assertTrue($combinedArray === $ma->toArray()); }
public function testCombineWith() { $firstArray = [1 => 'one', 2 => 'two', 3 => 'three']; $secondArray = ['one' => 1, 1 => 'one', 2 => 2]; $arrayzy = new A($firstArray); $resultArrayzy = $arrayzy->combineWith($secondArray); $resultArray = array_combine($firstArray, $secondArray); $this->assertMutable($arrayzy, $resultArrayzy, $resultArray); }