summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-28 20:58:08 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-28 20:58:08 +0000
commit0e48fc4eced57b2d8dc7e3fe336b49e83a97663a (patch)
tree43090cef27e84ecaab880aa86c6059a8e9e0e3c3 /modules
parente174039d6fc745c851e8ca5ce37a38dafd34cfe8 (diff)
downloadbrdo-0e48fc4eced57b2d8dc7e3fe336b49e83a97663a.tar.gz
brdo-0e48fc4eced57b2d8dc7e3fe336b49e83a97663a.tar.bz2
- Patch #668150 by mfb: fxed theme_item_list() when used with nested lists.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/theme.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index 9b5c5c2d2..ff6250546 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -93,3 +93,31 @@ class ThemeTableUnitTest extends DrupalWebTestCase {
drupal_static_reset('drupal_add_js');
}
}
+
+/**
+ * Unit tests for theme_item_list().
+ */
+class ThemeItemListUnitTest extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Theme item list',
+ 'description' => 'Test the theme_item_list() function.',
+ 'group' => 'Theme',
+ );
+ }
+
+ /**
+ * Test nested list rendering.
+ */
+ function testNestedList() {
+ $items = array('a', array('data' => 'b', 'children' => array('c', 'd')), 'e');
+ $expected = '<div class="item-list"><ul><li class="first">a</li>
+<li>b<div class="item-list"><ul><li class="first">c</li>
+<li class="last">d</li>
+</ul></div></li>
+<li class="last">e</li>
+</ul></div>';
+ $output = theme('item_list', array('items' => $items, 'type' => 'ul', 'title' => NULL, 'attributes' => array()));
+ $this->assertIdentical($expected, $output, 'Nested list is rendered correctly.');
+ }
+}