public function VariantRouteFilterTest::testFilterNonMatchingRoute in Page Manager 8
Same name and namespace in other branches
- 8.4 tests/src/Unit/VariantRouteFilterTest.php \Drupal\Tests\page_manager\Unit\VariantRouteFilterTest::testFilterNonMatchingRoute()
@covers ::filter @covers ::getVariantRouteName
File
- tests/
src/ Unit/ VariantRouteFilterTest.php, line 131 - Contains \Drupal\Tests\page_manager\Unit\VariantRouteFilterTest.
Class
- VariantRouteFilterTest
- @coversDefaultClass \Drupal\page_manager\Routing\VariantRouteFilter @group PageManager
Namespace
Drupal\Tests\page_manager\UnitCode
public function testFilterNonMatchingRoute() {
$route_collection = new RouteCollection();
$request = new Request();
$route = new Route('/path/with/{slug}');
$route_collection
->add('a_route', $route);
$this->currentPath
->getPath($request)
->willReturn('');
$result = $this->routeFilter
->filter($route_collection, $request);
$expected = [
'a_route' => $route,
];
$this
->assertSame($expected, $result
->all());
$this
->assertSame([], $request->attributes
->all());
}