function ThemeItemListUnitTest::testItemList

Test item list rendering.

File

modules/simpletest/tests/theme.test, line 279

Class

ThemeItemListUnitTest
Unit tests for theme_item_list().

Code

function testItemList() {
    $items = array(
        'a',
        array(
            'data' => 'b',
            'children' => array(
                'c' => 'c',
                'd' => 'd',
                'e' => 'e',
            ),
        ),
        'f',
    );
    $expected = '<div class="item-list"><ul><li class="first">a</li>
<li>b<div class="item-list"><ul><li class="first">c</li>
<li>d</li>
<li class="last">e</li>
</ul></div></li>
<li class="last">f</li>
</ul></div>';
    $output = theme('item_list', array(
        'items' => $items,
    ));
    $this->assertIdentical($expected, $output, 'Item list is rendered correctly.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.