function TableTest::testThemeTableStickyHeaders
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableStickyHeaders()
- 8.9.x core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableStickyHeaders()
- 10 core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableStickyHeaders()
If $sticky is TRUE, `sticky-header` class should be included.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ Element/ TableTest.php, line 24
Class
- TableTest
- Tests built-in table theme functions.
Namespace
Drupal\KernelTests\Core\Render\ElementCode
public function testThemeTableStickyHeaders() : void {
$header = [
'one',
'two',
'three',
];
$rows = [
[
1,
2,
3,
],
[
4,
5,
6,
],
[
7,
8,
9,
],
];
$table = [
'#type' => 'table',
'#header' => $header,
'#rows' => $rows,
'#sticky' => TRUE,
];
$this->render($table);
$this->assertRaw('sticky-header');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.