You are here

public function RouterTest::testControllerResolutionAjax in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Routing/RouterTest.php \Drupal\system\Tests\Routing\RouterTest::testControllerResolutionAjax()

Checks that an ajax request gets rendered as an Ajax response, by mime.

File

core/modules/system/src/Tests/Routing/RouterTest.php, line 255
Contains \Drupal\system\Tests\Routing\RouterTest.

Class

RouterTest
Functional class for the full integrated routing system.

Namespace

Drupal\system\Tests\Routing

Code

public function testControllerResolutionAjax() {

  // This will fail with a JSON parse error if the request is not routed to
  // The correct controller.
  $this
    ->drupalGetAjax('/router_test/test10');
  $this
    ->assertEqual($this
    ->drupalGetHeader('Content-Type'), 'application/json', 'Correct mime content type was returned');
  $this
    ->assertRaw('abcde', 'Correct body was found.');
}