You are here

public function FrameworkTest::testAJAXRenderError 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::testAJAXRenderError()

Tests the behavior of an error alert command.

File

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

Class

FrameworkTest
Performs tests on AJAX framework functions.

Namespace

Drupal\system\Tests\Ajax

Code

public function testAJAXRenderError() {

  // Verify custom error message.
  $edit = array(
    'message' => 'Custom error message.',
  );
  $commands = $this
    ->drupalGetAjax('ajax-test/render-error', array(
    'query' => $edit,
  ));
  $expected = new AlertCommand($edit['message']);
  $this
    ->assertCommand($commands, $expected
    ->render(), 'Custom error message is output.');
}