You are here

function TableTest::testThemeTableWithNoStriping in Zircon Profile 8

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

Tests that the 'no_striping' option works correctly.

File

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

Class

TableTest
Tests built-in table theme functions.

Namespace

Drupal\system\Tests\Render\Element

Code

function testThemeTableWithNoStriping() {
  $rows = array(
    array(
      'data' => array(
        1,
      ),
      'no_striping' => TRUE,
    ),
  );
  $table = array(
    '#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.');
}