function OptionsFieldUIAllowedValuesTest::assertNodeFormOrder

Same name in other branches
  1. 10 core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUIAllowedValuesTest.php \Drupal\Tests\options\FunctionalJavascript\OptionsFieldUIAllowedValuesTest::assertNodeFormOrder()

Asserts the order of provided option list on node form.

Parameters

array $expected: Expected order.

1 call to OptionsFieldUIAllowedValuesTest::assertNodeFormOrder()
OptionsFieldUIAllowedValuesTest::testOptionsAllowedValues in core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUIAllowedValuesTest.php
Tests option types allowed values.

File

core/modules/options/tests/src/FunctionalJavascript/OptionsFieldUIAllowedValuesTest.php, line 241

Class

OptionsFieldUIAllowedValuesTest
Tests the Options field allowed values UI functionality.

Namespace

Drupal\Tests\options\FunctionalJavascript

Code

protected function assertNodeFormOrder($expected) {
    $elements = $this->assertSession()
        ->selectExists('field_options_text')
        ->findAll('css', 'option');
    $elements = array_map(function ($element) {
        return $element->getText();
    }, $elements);
    $this->assertSame($expected, $elements);
}

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