function OptionsFieldUITest::testOptionsTrimmedValuesText

Same name in other branches
  1. 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\Functional

Code

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.