OptionsListArgumentTest.php in Drupal 9
File
core/modules/options/tests/src/Kernel/Views/OptionsListArgumentTest.php
View source
<?php
namespace Drupal\Tests\options\Kernel\Views;
use Drupal\views\Views;
class OptionsListArgumentTest extends OptionsTestBase {
public static $testViews = [
'test_options_list_argument_numeric',
'test_options_list_argument_string',
];
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);
}
}