You are here

public function TableTest::testThemeTableNotResponsiveHeaders in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableNotResponsiveHeaders()
  2. 10 core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableNotResponsiveHeaders()

Tests that the 'responsive-table' class is not applied without headers.

File

core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php, line 174

Class

TableTest
Tests built-in table theme functions.

Namespace

Drupal\KernelTests\Core\Render\Element

Code

public function testThemeTableNotResponsiveHeaders() {
  $rows = [
    [
      1,
      2,
      3,
    ],
    [
      4,
      5,
      6,
    ],
    [
      7,
      8,
      9,
    ],
  ];
  $table = [
    '#type' => 'table',
    '#rows' => $rows,
    '#responsive' => TRUE,
  ];
  $this
    ->render($table);
  $this
    ->assertNoRaw('responsive-enabled', 'The responsive-enabled class is not applied without table headers.');
}