You are here

public function FrameworkTest::testAJAXRender in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Ajax/FrameworkTest.php \Drupal\system\Tests\Ajax\FrameworkTest::testAJAXRender()

Ensures \Drupal\Core\Ajax\AjaxResponse::ajaxRender() returns JavaScript settings from the page request.

File

core/modules/system/src/Tests/Ajax/FrameworkTest.php, line 27
Contains \Drupal\system\Tests\Ajax\FrameworkTest.

Class

FrameworkTest
Performs tests on AJAX framework functions.

Namespace

Drupal\system\Tests\Ajax

Code

public function testAJAXRender() {

  // Verify that settings command is generated if JavaScript settings exist.
  $commands = $this
    ->drupalGetAjax('ajax-test/render');
  $expected = new SettingsCommand(array(
    'ajax' => 'test',
  ), TRUE);
  $this
    ->assertCommand($commands, $expected
    ->render(), '\\Drupal\\Core\\Ajax\\AjaxResponse::ajaxRender() loads JavaScript settings.');
}