function ViewAjaxControllerTest::testAjaxViewWithHtmlEntityArguments

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest::testAjaxViewWithHtmlEntityArguments()
  2. 8.9.x core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest::testAjaxViewWithHtmlEntityArguments()
  3. 10 core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest::testAjaxViewWithHtmlEntityArguments()

Tests a valid view with arguments.

File

core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php, line 314

Class

ViewAjaxControllerTest
@coversDefaultClass \Drupal\views\Controller\ViewAjaxController @group views

Namespace

Drupal\Tests\views\Unit\Controller

Code

public function testAjaxViewWithHtmlEntityArguments() : void {
    $request = new Request();
    $request->request
        ->set('view_name', 'test_view');
    $request->request
        ->set('view_display_id', 'page_1');
    $request->request
        ->set('view_args', 'arg1 & arg2/arg3');
    $executable = $this->setupValidMocks();
    $executable->expects($this->once())
        ->method('preview')
        ->with('page_1', [
        'arg1 & arg2',
        'arg3',
    ]);
    $response = $this->viewAjaxController
        ->ajaxView($request);
    $this->assertInstanceOf(ViewAjaxResponse::class, $response);
    $this->assertViewResultCommand($response);
}

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