You are here

function FormsElementsTableSelectFunctionalTest::testMultipleTrue in SimpleTest 7

Test the display of checkboxes when #multiple is TRUE.

File

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

Class

FormsElementsTableSelectFunctionalTest
Test the tableselect form element for expected behavior.

Code

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

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