public function QueryParameterTest::testGetArgument in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()
- 9 core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()
Tests the getArgument() method.
@covers ::getArgument @dataProvider providerGetArgument
File
- core/
modules/ views/ tests/ src/ Unit/ Plugin/ argument_default/ QueryParameterTest.php, line 21
Class
- QueryParameterTest
- @coversDefaultClass \Drupal\views\Plugin\views\argument_default\QueryParameter @group views
Namespace
Drupal\Tests\views\Unit\Plugin\argument_defaultCode
public function testGetArgument($options, Request $request, $expected) {
$view = $this
->getMockBuilder('Drupal\\views\\ViewExecutable')
->disableOriginalConstructor()
->onlyMethods([])
->getMock();
$view
->setRequest($request);
$display_plugin = $this
->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')
->disableOriginalConstructor()
->getMock();
$raw = new QueryParameter([], 'query_parameter', []);
$raw
->init($view, $display_plugin, $options);
$this
->assertEquals($expected, $raw
->getArgument());
}