function RequestFormatRouteFilterTest::testFilter
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php \Drupal\Tests\Core\Routing\RequestFormatRouteFilterTest::testFilter()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php \Drupal\Tests\Core\Routing\RequestFormatRouteFilterTest::testFilter()
- 11.x core/tests/Drupal/Tests/Core/Routing/RequestFormatRouteFilterTest.php \Drupal\Tests\Core\Routing\RequestFormatRouteFilterTest::testFilter()
@covers ::filter @dataProvider filterProvider
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ RequestFormatRouteFilterTest.php, line 27
Class
- RequestFormatRouteFilterTest
- @coversDefaultClass \Drupal\Core\Routing\RequestFormatRouteFilter @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testFilter(RouteCollection $collection, $request_format, array $expected_filtered_collection) : void {
$route_filter = new RequestFormatRouteFilter();
$request = new Request();
$request->setRequestFormat($request_format);
$collection = $route_filter->filter($collection, $request);
$this->assertSameSize($expected_filtered_collection, $collection);
$this->assertSame($expected_filtered_collection, array_keys($collection->all()));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.