You are here

public function RouterTest::testDynamicRoutes in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Routing/RouterTest.php \Drupal\Tests\system\Functional\Routing\RouterTest::testDynamicRoutes()

Checks that dynamically defined and altered routes work correctly.

See also

\Drupal\router_test\RouteSubscriber

File

core/modules/system/tests/src/Functional/Routing/RouterTest.php, line 200

Class

RouterTest
Functional class for the full integrated routing system.

Namespace

Drupal\Tests\system\Functional\Routing

Code

public function testDynamicRoutes() {

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