function MethodFilterTest::testWithAllowedMethod
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testWithAllowedMethod()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testWithAllowedMethod()
- 11.x core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testWithAllowedMethod()
@covers ::filter
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ MethodFilterTest.php, line 23
Class
- MethodFilterTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Routing%21MethodFilter.php/class/MethodFilter/10" title="Filters routes based on the HTTP method." class="local">\Drupal\Core\Routing\MethodFilter</a> @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testWithAllowedMethod() : void {
$request = Request::create('/test', 'GET');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], [
'GET',
]));
$collection_before = clone $collection;
$method_filter = new MethodFilter();
$result_collection = $method_filter->filter($collection, $request);
$this->assertEquals($collection_before, $result_collection);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.