function TableTest::testThemeTableWithNoStriping
Tests that the 'no_striping' option works correctly.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ Render/ Element/ TableTest.php, line 93  
Class
- TableTest
 - Tests built-in table theme functions.
 
Namespace
Drupal\KernelTests\Core\Render\ElementCode
public function testThemeTableWithNoStriping() : void {
  $rows = [
    [
      'data' => [
        1,
      ],
      'no_striping' => TRUE,
    ],
  ];
  $table = [
    '#type' => 'table',
    '#rows' => $rows,
  ];
  $this->render($table);
  $this->assertNoRaw('class="odd"', 'Odd/even classes were not added because $no_striping = TRUE.');
  $this->assertNoRaw('no_striping', 'No invalid no_striping HTML attribute was printed.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.