From 0e48fc4eced57b2d8dc7e3fe336b49e83a97663a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 28 Dec 2009 20:58:08 +0000 Subject: - Patch #668150 by mfb: fxed theme_item_list() when used with nested lists. --- modules/simpletest/tests/theme.test | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'modules') 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 = '
'; + $output = theme('item_list', array('items' => $items, 'type' => 'ul', 'title' => NULL, 'attributes' => array())); + $this->assertIdentical($expected, $output, 'Nested list is rendered correctly.'); + } +} -- cgit v1.2.3