You are here

public function RouteProviderTest::testGetRoutesCount in Drupal 9

Tests getRoutesCount().

@group legacy

File

core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php, line 769
Contains \Drupal\KernelTests\Core\Routing\RouteProviderTest.

Class

RouteProviderTest
Confirm that the default route provider is working correctly.

Namespace

Drupal\KernelTests\Core\Routing

Code

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());
}