2 require_once 'include/utils.php';
4 class SugarArrayMergeTest extends Sugar_PHPUnit_Framework_TestCase
9 public function testSubArrayOrderIsPreserved()
29 $results = sugarArrayMerge($array1,$array2);
31 $keys1 = array_keys($results['dog']);
32 $keys2 = array_keys($array2['dog']);
34 for ( $i = 0; $i < 4; $i++ ) {
35 $this->assertEquals($keys1[$i],$keys2[$i]);
39 public function testSugarArrayMergeMergesTwoArraysWithLikeKeysOverwritingExistingKeys()
67 $this->assertEquals(sugarArrayMerge($foo, $bar), $expected);
68 // insure that internal functions can't duplicate behavior
69 $this->assertNotEquals(array_merge($foo, $bar), $expected);
70 $this->assertNotEquals(array_merge_recursive($foo, $bar), $expected);