public function MethodFilterTest::testWithAllowedMethod in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testWithAllowedMethod()
- 10 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 21
Class
- MethodFilterTest
- @coversDefaultClass \Drupal\Core\Routing\MethodFilter @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testWithAllowedMethod() {
$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);
}