public function OptionsFieldUITest::testOptionsTrimmedValuesText in Drupal 8
Same name and namespace in other branches
- 9 core/modules/options/tests/src/Functional/OptionsFieldUITest.php \Drupal\Tests\options\Functional\OptionsFieldUITest::testOptionsTrimmedValuesText()
Options (text) : test 'trimmed values' input.
File
- core/
modules/ options/ tests/ src/ Functional/ OptionsFieldUITest.php, line 270
Class
- OptionsFieldUITest
- Tests the Options field UI functionality.
Namespace
Drupal\Tests\options\FunctionalCode
public function testOptionsTrimmedValuesText() {
$this->fieldName = 'field_options_trimmed_text';
$this
->createOptionsField('list_string');
// Explicit keys.
$string = "zero |Zero\none | One";
$array = [
'zero' => 'Zero',
'one' => 'One',
];
$this
->assertAllowedValuesInput($string, $array, 'Explicit keys are accepted and trimmed.');
}