function PathMatcherTest::testExactPathMatch

Confirms that we can find routes with the exact incoming path.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Routing/PathMatcherTest.php, line 78
Definition of Drupal\system\Tests\Routing\PartialMatcherTest.

Class

PathMatcherTest
Basic tests for the UrlMatcherDumper.

Namespace

Drupal\system\Tests\Routing

Code

function testExactPathMatch() {
  $connection = Database::getConnection();
  $matcher = new PathMatcher($connection, 'test_routes');
  $this->fixtures
    ->createTables($connection);
  $dumper = new MatcherDumper($connection, 'test_routes');
  $dumper
    ->addRoutes($this->fixtures
    ->sampleRouteCollection());
  $dumper
    ->dump();
  $path = '/path/one';
  $request = Request::create($path, 'GET');
  $routes = $matcher
    ->matchRequestPartial($request);
  foreach ($routes as $route) {
    $this
      ->assertEqual($route
      ->getPattern(), $path, 'Found path has correct pattern');
  }
}