function TableTest::testThemeTableNotResponsiveProperty
Tests that 'responsive-table' class only applied when responsive is TRUE.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ Render/ Element/ TableTest.php, line 184  
Class
- TableTest
 - Tests built-in table theme functions.
 
Namespace
Drupal\KernelTests\Core\Render\ElementCode
public function testThemeTableNotResponsiveProperty() : void {
  $header = [
    'one',
    'two',
    'three',
  ];
  $rows = [
    [
      1,
      2,
      3,
    ],
    [
      4,
      5,
      6,
    ],
    [
      7,
      8,
      9,
    ],
  ];
  $table = [
    '#type' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#responsive' => FALSE,
  ];
  $this->render($table);
  $this->assertNoRaw('responsive-enabled', 'The responsive-enabled class is not applied without the "responsive" property set to TRUE.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.