1 theme.test | ThemeTableUnitTest::testThemeTableNoStickyHeaders() |
If $sticky is FALSE, no tableheader.js should be included.
File
- core/
modules/ simpletest/ tests/ theme.test, line 180 - Tests for the theme API.
Class
- ThemeTableUnitTest
- Unit tests for theme_table().
Code
function testThemeTableNoStickyHeaders() {
$header = array('one', 'two', 'three');
$rows = array(array(1, 2, 3), array(4, 5, 6), array(7, 8, 9));
$attributes = array();
$caption = NULL;
$colgroups = array();
$this->content = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes, 'caption' => $caption, 'colgroups' => $colgroups, 'sticky' => FALSE));
$js = backdrop_add_js();
$this->assertFalse(isset($js['core/misc/tableheader.js']), 'tableheader.js was not included because $sticky = FALSE.');
$this->assertNoRaw('sticky-enabled', 'Table does not have a class of sticky-enabled because $sticky = FALSE.');
backdrop_static_reset('backdrop_add_js');
}