function ViewAjaxControllerTest::assertViewResultCommand

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

Ensures that the main view content command is added.

@internal

Parameters

\Drupal\views\Ajax\ViewAjaxResponse $response: The response object.

int $position: The position where the view content command is expected.

6 calls to ViewAjaxControllerTest::assertViewResultCommand()
ViewAjaxControllerTest::testAjaxView in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view without arguments pagers etc.
ViewAjaxControllerTest::testAjaxViewViewPathNoSlash in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view with a view_path with no slash.
ViewAjaxControllerTest::testAjaxViewWithArguments in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view with arguments.
ViewAjaxControllerTest::testAjaxViewWithEmptyArguments in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view with arguments.
ViewAjaxControllerTest::testAjaxViewWithHtmlEntityArguments in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view with arguments.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\views\Unit\Controller

Code

protected function assertViewResultCommand(ViewAjaxResponse $response, int $position = 0) : void {
    $commands = $this->getCommands($response);
    $this->assertEquals('insert', $commands[$position]['command']);
    $this->assertEquals('View result', $commands[$position]['data']);
}

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