1 list.test ListFieldUITestCase::assertAllowedValuesInput($input_string, $result, $message)

Tests a string input for the 'allowed values' form element.

Parameters

$input_string: The input string, in the pipe-linefeed format expected by the form element.

$result: Either an expected resulting array in $field['settings']['allowed_values'], or an expected error message.

$message: Message to display.

File

core/modules/field/modules/list/tests/list.test, line 487
Tests for list.module.

Class

ListFieldUITestCase
List module UI tests.

Code

function assertAllowedValuesInput($input_string, $result, $message) {
  $edit = array('field[settings][allowed_values][options_field]' => $input_string);
  $this->backdropPost($this->admin_path, $edit, t('Save settings'));

  if (is_string($result)) {
    $this->assertText($result, $message);
  }
  else {
    field_info_cache_clear();
    $field = field_info_field($this->field_name);
    $this->assertIdentical($field['settings']['allowed_values'], $result, $message);
  }
}