1 theme.test ThemeTableUnitTest::testThemeTableStickyHeaders()

Tableheader.js provides 'sticky' table headers, and is included by default.

File

core/modules/simpletest/tests/theme.test, line 167
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 = backdrop_add_js();
  $this->assertTrue(isset($js['core/misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.');
  $this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.');
  backdrop_static_reset('backdrop_add_js');
}