only in patch2: unchanged: --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -1988,6 +1988,18 @@ class DrupalRenderTestCase extends DrupalWebTestCase { // The elements should appear in output in the same order as the array. $this->assertTrue(strpos($output, $second) < strpos($output, $first), 'Elements were not sorted.'); + + // The order of children with same weight should be preserved. + $element_mixed_weight = array( + 'child5' => array('#weight' => 10), + 'child3' => array('#weight' => -10), + 'child1' => array(), + 'child4' => array('#weight' => 10), + 'child2' => array(), + ); + + $expected = array('child3', 'child1', 'child2', 'child5', 'child4'); + $this->assertEqual($expected, element_children($element_mixed_weight, TRUE), 'Orders of Elemenets with same weights are kept.'); } /**