Example #1
0
 /**
  * @covers \Drupal\Core\Ajax\RedirectCommand
  */
 public function testRedirectCommand()
 {
     $command = new RedirectCommand('http://example.com');
     $expected = array('command' => 'redirect', 'url' => 'http://example.com');
     $this->assertEquals($expected, $command->render());
 }
 /**
  * Tests that RedirectCommand objects can be constructed and rendered.
  */
 public function testRedirectCommand()
 {
     $command = new RedirectCommand('http://example.com');
     $expected = array('command' => 'redirect', 'url' => 'http://example.com');
     $this->assertEquals($command->render(), $expected, "RedirectCommand::render() didn't return the expected command array.");
 }