summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 04:43:00 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 04:43:00 +0000
commitb83aa19bb29b7de0f16dcb25e8d7abeb8b10ac2f (patch)
tree4fe200b7863dad0385d97f5a044584bf2330c1d1 /modules/simpletest
parent826cf54d84ab7d8d08fcb7d73397fc2b0ae6ae97 (diff)
downloadbrdo-b83aa19bb29b7de0f16dcb25e8d7abeb8b10ac2f.tar.gz
brdo-b83aa19bb29b7de0f16dcb25e8d7abeb8b10ac2f.tar.bz2
#370846 follow-up by catch: Fix #weight sorting in drupal_render().
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/common.test10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 209b4503d..3aa248e6b 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -542,7 +542,15 @@ class DrupalRenderUnitTestCase extends DrupalWebTestCase {
// Confirm that the $elements array has '#sorted' set to TRUE.
$this->assertTrue($elements['#sorted'], t("'#sorted' => TRUE was added to the array"));
- // Now the same array structure, but with #sorted set to TRUE.
+ // Pass $elements through element_children() and ensure it remains
+ // sorted in the correct order. drupal_render() will return an empty string
+ // if used on the same array in the same request.
+ $children = element_children($elements);
+ $this->assertTrue(array_shift($children) == 'first', t('Child found in the correct order.'));
+ $this->assertTrue(array_shift($children) == 'second', t('Child found in the correct order.'));
+
+
+ // The same array structure again, but with #sorted set to TRUE.
$elements = array(
'second' => array(
'#weight' => 10,