You are here

function ElementsTableSelectTest::testMultipleFalse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Form/ElementsTableSelectTest.php \Drupal\system\Tests\Form\ElementsTableSelectTest::testMultipleFalse()

Test the display of radios when #multiple is FALSE.

File

core/modules/system/src/Tests/Form/ElementsTableSelectTest.php, line 48
Contains \Drupal\system\Tests\Form\ElementsTableSelectTest.

Class

ElementsTableSelectTest
Tests the tableselect form element for expected behavior.

Namespace

Drupal\system\Tests\Form

Code

function testMultipleFalse() {
  $this
    ->drupalGet('form_test/tableselect/multiple-false');
  $this
    ->assertNoText(t('Empty text.'), 'Empty text should not be displayed.');

  // Test for the absence of the Select all rows tableheader.
  $this
    ->assertNoFieldByXPath('//th[@class="select-all"]', '', 'Absence of the "Select all" checkbox.');
  $rows = array(
    'row1',
    'row2',
    'row3',
  );
  foreach ($rows as $row) {
    $this
      ->assertFieldByXPath('//input[@type="radio"]', $row, format_string('Radio button for value @row.', array(
      '@row' => $row,
    )));
  }
}