function AjaxCommandsUnitTest::testRedirectCommand

Tests that RedirectCommand objects can be constructed and rendered.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Ajax/AjaxCommandsUnitTest.php, line 422
Definition of Drupal\system\Tests\Ajax\AjaxCommandsUnitTest.

Class

AjaxCommandsUnitTest
Tests for all AJAX Commands.

Namespace

Drupal\system\Tests\Ajax

Code

function testRedirectCommand() {
  $command = new RedirectCommand('http://example.com');
  $expected = array(
    'command' => 'redirect',
    'url' => 'http://example.com',
  );
  $this
    ->assertEqual($command
    ->render(), $expected, 'RedirectCommand::render() with the expected command array.');
}