function RouteProviderTest::testGetRoutesCount
Tests getRoutesCount().
@group legacy
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Routing/ RouteProviderTest.php, line 775
Class
- RouteProviderTest
- Confirm that the default route provider is working correctly.
Namespace
Drupal\KernelTests\Core\RoutingCode
public function testGetRoutesCount() {
$this->expectDeprecation('Drupal\\Core\\Routing\\RouteProvider::getRoutesCount() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3151009');
$connection = Database::getConnection();
$provider = new RouteProvider($connection, $this->state, $this->currentPath, $this->cache, $this->pathProcessor, $this->cacheTagsInvalidator, 'test_routes');
$this->fixtures
->createTables($connection);
$dumper = new MatcherDumper($connection, $this->state, 'test_routes');
$dumper->addRoutes($this->fixtures
->sampleRouteCollection());
$dumper->dump();
$this->assertEquals(5, $provider->getRoutesCount());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.