You are here

function SelectOrOtherNumberTestCase::testNoOtherSelected in Select (or other) 7.3

Same name and namespace in other branches
  1. 7.2 tests/select_or_other_number.test \SelectOrOtherNumberTestCase::testNoOtherSelected()

Tests Select or Other without other selected.

File

tests/select_or_other_number.test, line 55

Class

SelectOrOtherNumberTestCase
Tests the select or other text field based functionality

Code

function testNoOtherSelected() {
  foreach ($this->fields as $field_name => $field) {
    $options = $this
      ->getAvailableOptions($field['instance_settings']);
    $keys = array_keys($options);
    $this
      ->setFieldValue($field_name, $keys[0]);

    // Add the </div> because assertRaw fails for integer values.
    $this
      ->assertRaw("{$keys[0]}</div>");
    $this
      ->assertNoRaw('select_or_other');
  }
}