Confirms that we can add routes to the dumper when it already has some.
function testAddAdditionalRoutes() {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection);
$route = new Route('test');
$collection = new RouteCollection();
$collection
->add('test_route', $route);
$dumper
->addRoutes($collection);
$route = new Route('test2');
$collection2 = new RouteCollection();
$collection2
->add('test_route2', $route);
$dumper
->addRoutes($collection2);
// Merge the two collections together so we can test them.
$collection
->addCollection(clone $collection2);
$dumper_routes = $dumper
->getRoutes()
->all();
$collection_routes = $collection
->all();
$success = TRUE;
foreach ($collection_routes as $name => $route) {
if (empty($dumper_routes[$name])) {
$success = FALSE;
$this
->fail(t('Not all routes found in the dumper.'));
}
}
if ($success) {
$this
->pass('All routes found in the dumper.');
}
}