You are here

public function QueryParameterTest::testGetArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest::testGetArgument()

Test the getArgument() method.

@covers ::getArgument @dataProvider providerGetArgument

File

core/modules/views/tests/src/Unit/Plugin/argument_default/QueryParameterTest.php, line 26
Contains \Drupal\Tests\views\Unit\Plugin\argument_default\QueryParameterTest.

Class

QueryParameterTest
@coversDefaultClass \Drupal\views\Plugin\views\argument_default\QueryParameter @group views

Namespace

Drupal\Tests\views\Unit\Plugin\argument_default

Code

public function testGetArgument($options, Request $request, $expected) {
  $view = $this
    ->getMockBuilder('Drupal\\views\\ViewExecutable')
    ->disableOriginalConstructor()
    ->setMethods(NULL)
    ->getMock();
  $view
    ->setRequest($request);
  $display_plugin = $this
    ->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')
    ->disableOriginalConstructor()
    ->getMock();
  $raw = new QueryParameter(array(), 'query_parameter', array());
  $raw
    ->init($view, $display_plugin, $options);
  $this
    ->assertEquals($expected, $raw
    ->getArgument());
}