You are here

function FormsElementsTableSelectFunctionalTest::testMultipleFalse in SimpleTest 7

Test the display of radios when #multiple is FALSE.

File

tests/form.test, line 169
Unit tests for the Drupal Form API.

Class

FormsElementsTableSelectFunctionalTest
Test the tableselect form element for expected behavior.

Code

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

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