/** * Should be able to tell same arrays */ public function testDiff_NoDifference() { $array1 = [1, 2, 9, 3, 5, 6, 8, 'string']; $array2 = [1, 2, 9, 3, 5, 6, 8, 'string']; $expect = []; $result = Arrays::Diff($array1, $array2); $this->assertEqual($expect, $result); }
/** * Assert that given arrays are equal * * @param array $array1 First array * @param array $array2 Second array * @param string $message [optional] The testing error message * * @return boolean If this test passed */ public function assertArrayEqual(array $array1, array $array2, $message = null) { $diff = \Utils\Arrays::Diff($array1, $array2); return $this->assert(new EqualExpectation(0), sizeof($diff), !empty($message) ? $message : sprintf("Arrays not equal, difference: %s", dump($diff, true))); }