function ThemeTableUnitTest::testThemeTableStickyHeaders in SimpleTest 7
Tableheader.js provides 'sticky' table headers, and is included by default.
File
- tests/
theme.test, line 69 - Tests for the theme API.
Class
- ThemeTableUnitTest
- Unit tests for theme_table().
Code
function testThemeTableStickyHeaders() {
$header = array(
'one',
'two',
'three',
);
$rows = array(
array(
1,
2,
3,
),
array(
4,
5,
6,
),
array(
7,
8,
9,
),
);
$this->content = theme('table', array(
'header' => $header,
'rows' => $rows,
));
$js = drupal_add_js();
$this
->assertTrue(isset($js['misc/tableheader.js']), t('tableheader.js was included when $sticky = TRUE.'));
$this
->assertRaw('sticky-enabled', t('Table has a class of sticky-enabled when $sticky = TRUE.'));
drupal_static_reset('drupal_add_js');
}