You are here

public function TableTest::testThemeTableResponsive in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/system/src/Tests/Theme/TableTest.php \Drupal\system\Tests\Theme\TableTest::testThemeTableResponsive()
  2. 8 core/modules/system/src/Tests/Render/Element/TableTest.php \Drupal\system\Tests\Render\Element\TableTest::testThemeTableResponsive()
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::testThemeTableResponsive()

Tests that the 'responsive-table' class is applied correctly.

File

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

Class

TableTest
Tests built-in table theme functions.

Namespace

Drupal\system\Tests\Render\Element

Code

public function testThemeTableResponsive() {
  $header = array(
    'one',
    'two',
    'three',
  );
  $rows = array(
    array(
      1,
      2,
      3,
    ),
    array(
      4,
      5,
      6,
    ),
    array(
      7,
      8,
      9,
    ),
  );
  $table = array(
    '#type' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#responsive' => TRUE,
  );
  $this
    ->render($table);
  $this
    ->assertRaw('responsive-enabled', 'The responsive-enabled class was printed correctly.');
}