public function RouterTest::testDynamicRoutes

Checks that dynamically defined and altered routes work correctly.

See also

\Drupal\router_test\RouteSubscriber

File

drupal/core/modules/system/lib/Drupal/system/Tests/Routing/RouterTest.php, line 116
Definition of Drupal\system\Tests\Routing\RouterTest.

Class

RouterTest
Functional class for the full integrated routing system.

Namespace

Drupal\system\Tests\Routing

Code

public function testDynamicRoutes() {

  // Test the dynamically added route.
  $this
    ->drupalGet('router_test/test5');
  $this
    ->assertResponse(200);
  $this
    ->assertRaw('test5', 'The correct string was returned because the route was successful.');

  // Test the altered route.
  $this
    ->drupalGet('router_test/test6');
  $this
    ->assertResponse(200);
  $this
    ->assertRaw('test5', 'The correct string was returned because the route was successful.');
}