You are here

function TableTest::testThemeTableHeaderCellOption in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/system/src/Tests/Theme/TableTest.php \Drupal\system\Tests\Theme\TableTest::testThemeTableHeaderCellOption()
  2. 8 core/modules/system/src/Tests/Render/Element/TableTest.php \Drupal\system\Tests\Render\Element\TableTest::testThemeTableHeaderCellOption()
Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Render/Element/TableTest.php \Drupal\system\Tests\Render\Element\TableTest::testThemeTableHeaderCellOption()

Tests that the 'header' option in cells works correctly.

File

core/modules/system/src/Tests/Render/Element/TableTest.php, line 153
Contains \Drupal\system\Tests\Render\Element\TableTest.

Class

TableTest
Tests built-in table theme functions.

Namespace

Drupal\system\Tests\Render\Element

Code

function testThemeTableHeaderCellOption() {
  $rows = array(
    array(
      array(
        'data' => 1,
        'header' => TRUE,
      ),
      array(
        'data' => 1,
        'header' => FALSE,
      ),
      array(
        'data' => 1,
      ),
    ),
  );
  $table = array(
    '#type' => 'table',
    '#rows' => $rows,
  );
  $this
    ->render($table);
  $this
    ->removeWhiteSpace();
  $this
    ->assertRaw('<th>1</th><td>1</td><td>1</td>', 'The th and td tags was printed correctly.');
}