3 namespace Drupal\Tests\options\Kernel\Views;
5 use Drupal\views\Views;
8 * Tests options list argument for views.
10 * @see \Drupal\options\Plugin\views\argument\NumberListField.
13 class OptionsListArgumentTest extends OptionsTestBase {
16 * Views used by this test.
20 public static $testViews = ['test_options_list_argument_numeric', 'test_options_list_argument_string'];
23 * Tests the options field argument.
25 public function testViewsTestOptionsListArgument() {
26 $view = Views::getView('test_options_list_argument_numeric');
27 $this->executeView($view, [1]);
30 ['nid' => $this->nodes[0]->nid->value],
31 ['nid' => $this->nodes[1]->nid->value],
34 $column_map = ['nid' => 'nid'];
35 $this->assertIdenticalResultset($view, $resultset, $column_map);
37 $view = Views::getView('test_options_list_argument_string');
38 $this->executeView($view, ['man', 'woman']);
41 ['nid' => $this->nodes[0]->nid->value],
42 ['nid' => $this->nodes[1]->nid->value],
45 $column_map = ['nid' => 'nid'];
46 $this->assertIdenticalResultset($view, $resultset, $column_map);