You are here

protected function ViewAjaxControllerTest::assertViewResultCommand in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

Parameters

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

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

4 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::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::testAjaxViewWithPager in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Tests a valid view with a pager.

File

core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php, line 351
Contains \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest.

Class

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

Namespace

Drupal\Tests\views\Unit\Controller

Code

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