function MethodFilterTest::testMethodNotAllowedException
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testMethodNotAllowedException()
- 10 core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testMethodNotAllowedException()
- 11.x core/tests/Drupal/Tests/Core/Routing/MethodFilterTest.php \Drupal\Tests\Core\Routing\MethodFilterTest::testMethodNotAllowedException()
@covers ::filter
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ MethodFilterTest.php, line 54
Class
- MethodFilterTest
- @coversDefaultClass \Drupal\Core\Routing\MethodFilter @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testMethodNotAllowedException() {
$request = Request::create('/test', 'PATCH');
$collection = new RouteCollection();
$collection->add('test_route.get', new Route('/test', [], [], [], '', [], [
'GET',
]));
$this->expectException(MethodNotAllowedException::class);
$method_filter = new MethodFilter();
$method_filter->filter($collection, $request);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.