You are here

protected function ViewAjaxControllerTest::getCommands 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::getCommands()

Gets the commands entry from the response object.

Parameters

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

Return value

mixed Returns the commands.

2 calls to ViewAjaxControllerTest::getCommands()
ViewAjaxControllerTest::assertViewResultCommand in core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php
Ensures that the main view content command is added.
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 336
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 getCommands(ViewAjaxResponse $response) {
  $reflection_property = new \ReflectionProperty('Drupal\\views\\Ajax\\ViewAjaxResponse', 'commands');
  $reflection_property
    ->setAccessible(TRUE);
  $commands = $reflection_property
    ->getValue($response);
  return $commands;
}