public function MatcherDumperTest::testAddRoutes in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php \Drupal\KernelTests\Core\Routing\MatcherDumperTest::testAddRoutes()
- 9 core/tests/Drupal/KernelTests/Core/Routing/MatcherDumperTest.php \Drupal\KernelTests\Core\Routing\MatcherDumperTest::testAddRoutes()
Confirms that we can add routes to the dumper.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Routing/ MatcherDumperTest.php, line 57
Class
- MatcherDumperTest
- Confirm that the matcher dumper is functioning properly.
Namespace
Drupal\KernelTests\Core\RoutingCode
public function testAddRoutes() {
$connection = Database::getConnection();
$dumper = new MatcherDumper($connection, $this->state);
$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
->assertEquals($collection_routes[$name]
->getPath(), $route
->getPath(), 'Routes match');
}
}