function CurrentRouteMatchTest::testGetRouteMatchFromRequestWithRouting

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php \Drupal\Tests\Core\Routing\CurrentRouteMatchTest::testGetRouteMatchFromRequestWithRouting()
  2. 10 core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php \Drupal\Tests\Core\Routing\CurrentRouteMatchTest::testGetRouteMatchFromRequestWithRouting()
  3. 11.x core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php \Drupal\Tests\Core\Routing\CurrentRouteMatchTest::testGetRouteMatchFromRequestWithRouting()

@covers ::getRouteMatchFromRequest

File

core/tests/Drupal/Tests/Core/Routing/CurrentRouteMatchTest.php, line 77

Class

CurrentRouteMatchTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Routing%21CurrentRouteMatch.php/class/CurrentRouteMatch/9" title="Default object for current_route_match service." class="local">\Drupal\Core\Routing\CurrentRouteMatch</a> @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

public function testGetRouteMatchFromRequestWithRouting() {
    $request_stack = new RequestStack();
    $request = new Request();
    $request_stack->push($request);
    $current_route_match = new CurrentRouteMatch($request_stack);
    $route_match = $current_route_match->getRouteMatchFromRequest($request);
    $this->assertNull($route_match->getRouteName());
    $this->assertNull($route_match->getRouteObject());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.