function QueryParameterTest::testGetArgument

Same name and namespace in other branches
  1. 11.x core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()
  2. 10 core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()
  3. 9 core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()
  4. 8.9.x core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()

Tests the getArgument() method.

Attributes

#[DataProvider('providerGetArgument')]

File

core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php, line 31

Class

QueryParameterTest
Tests Drupal\views\Plugin\views\argument_default\QueryParameter.

Namespace

Drupal\Tests\views\Unit\Plugin\argument_default

Code

public function testGetArgument($options, Request $request, $expected) : void {
  $view = new ViewExecutable($this->createStub(ViewEntityInterface::class), $this->createStub(AccountInterface::class), $this->createStub(ViewsData::class), $this->createStub(RouteProviderInterface::class), $this->createStub(ViewsPluginManager::class));
  $view->setRequest($request);
  $display_plugin = $this->createStub(DisplayPluginBase::class);
  $raw = new QueryParameter([], 'query_parameter', []);
  $raw->init($view, $display_plugin, $options);
  $this->assertEquals($expected, $raw->getArgument());
}

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