function MatcherDumperTest::testAddRoutes

Confirms that we can add routes to the dumper.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Routing/MatcherDumperTest.php, line 61
Definition of Drupal\system\Tests\Routing\UrlMatcherDumperTest.

Class

MatcherDumperTest
Basic tests for the UrlMatcherDumper.

Namespace

Drupal\system\Tests\Routing

Code

function testAddRoutes() {
  $connection = Database::getConnection();
  $dumper = new MatcherDumper($connection);
  $route = new Route('test');
  $collection = new RouteCollection();
  $collection
    ->add('test_route', $route);
  $dumper
    ->addRoutes($collection);
  $dumper_routes = $dumper
    ->getRoutes()
    ->all();
  $collection_routes = $collection
    ->all();
  foreach ($dumper_routes as $name => $route) {
    $this
      ->assertEqual($route
      ->getPattern(), $collection_routes[$name]
      ->getPattern(), 'Routes match');
  }
}