function OptionsListArgumentTest::testViewsTestOptionsListArgument

Same name and namespace in other branches
  1. 8.9.x core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php \Drupal\Tests\options\Kernel\Views\OptionsListArgumentTest::testViewsTestOptionsListArgument()
  2. 10 core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php \Drupal\Tests\options\Kernel\Views\OptionsListArgumentTest::testViewsTestOptionsListArgument()
  3. 11.x core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php \Drupal\Tests\options\Kernel\Views\OptionsListArgumentTest::testViewsTestOptionsListArgument()

Tests the options field argument.

File

core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php, line 25

Class

OptionsListArgumentTest
Tests options list argument for views.

Namespace

Drupal\Tests\options\Kernel\Views

Code

public function testViewsTestOptionsListArgument() {
    $view = Views::getView('test_options_list_argument_numeric');
    $this->executeView($view, [
        1,
    ]);
    $resultset = [
        [
            'nid' => $this->nodes[0]->nid->value,
        ],
        [
            'nid' => $this->nodes[1]->nid->value,
        ],
    ];
    $column_map = [
        'nid' => 'nid',
    ];
    $this->assertIdenticalResultset($view, $resultset, $column_map);
    $view = Views::getView('test_options_list_argument_string');
    $this->executeView($view, [
        'man',
        'woman',
    ]);
    $resultset = [
        [
            'nid' => $this->nodes[0]->nid->value,
        ],
        [
            'nid' => $this->nodes[1]->nid->value,
        ],
    ];
    $column_map = [
        'nid' => 'nid',
    ];
    $this->assertIdenticalResultset($view, $resultset, $column_map);
}

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