function ViewAjaxControllerTest::getCommands

Same name in other branches
  1. 9 core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest::getCommands()
  2. 10 core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php \Drupal\Tests\views\Unit\Controller\ViewAjaxControllerTest::getCommands()
  3. 11.x 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 393

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;
}

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