public function UrlMatcherTest::testMethodNotAllowedAggregatesAllowedMethods in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php \Symfony\Component\Routing\Tests\Matcher\UrlMatcherTest::testMethodNotAllowedAggregatesAllowedMethods()
File
- vendor/
symfony/ routing/ Tests/ Matcher/ UrlMatcherTest.php, line 56
Class
Namespace
Symfony\Component\Routing\Tests\MatcherCode
public function testMethodNotAllowedAggregatesAllowedMethods() {
$coll = new RouteCollection();
$coll
->add('foo1', new Route('/foo', array(), array(), array(), '', array(), array(
'post',
)));
$coll
->add('foo2', new Route('/foo', array(), array(), array(), '', array(), array(
'put',
'delete',
)));
$matcher = new UrlMatcher($coll, new RequestContext());
try {
$matcher
->match('/foo');
$this
->fail();
} catch (MethodNotAllowedException $e) {
$this
->assertEquals(array(
'POST',
'PUT',
'DELETE',
), $e
->getAllowedMethods());
}
}