Commit 5451d564 authored by catch's avatar catch

Issue #2712633 by klausi, jibran, dawehner: Update symfony-cmf/routing to 1.4.0

parent 240586c0
......@@ -1140,36 +1140,38 @@
},
{
"name": "symfony-cmf/routing",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony-cmf/Routing.git",
"reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6"
"reference": "b93704ca098334f56e9b317932f21a4362e620db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/8e87981d72c6930a27585dcd3119f3199f6cb2a6",
"reference": "8e87981d72c6930a27585dcd3119f3199f6cb2a6",
"url": "https://api.github.com/repos/symfony-cmf/Routing/zipball/b93704ca098334f56e9b317932f21a4362e620db",
"reference": "b93704ca098334f56e9b317932f21a4362e620db",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"psr/log": "~1.0",
"symfony/http-kernel": "~2.2",
"symfony/routing": "~2.2"
"php": "^5.3.9|^7.0",
"psr/log": "1.*",
"symfony/http-kernel": "^2.2|3.*",
"symfony/routing": "^2.2|3.*"
},
"require-dev": {
"symfony/config": "~2.2",
"symfony/dependency-injection": "~2.0@stable",
"symfony/event-dispatcher": "~2.1"
"friendsofsymfony/jsrouting-bundle": "^1.1",
"symfony-cmf/testing": "^1.3",
"symfony/config": "^2.2|3.*",
"symfony/dependency-injection": "^2.0.5|3.*",
"symfony/event-dispatcher": "^2.1|3.*"
},
"suggest": {
"symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version ~2.1"
"symfony/event-dispatcher": "DynamicRouter can optionally trigger an event at the start of matching. Minimal version (~2.1)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
"dev-master": "1.4-dev"
}
},
"autoload": {
......@@ -1193,7 +1195,7 @@
"database",
"routing"
],
"time": "2014-10-20 20:55:17"
"time": "2016-03-31 09:11:39"
},
{
"name": "symfony/class-loader",
......
......@@ -22,7 +22,7 @@
"doctrine/common": "2.5.*",
"doctrine/annotations": "1.2.*",
"guzzlehttp/guzzle": "~6.1",
"symfony-cmf/routing": "1.3.*",
"symfony-cmf/routing": "~1.4",
"easyrdf/easyrdf": "0.9.*",
"zendframework/zend-feed": "~2.4",
"stack/builder": "1.0.*",
......
......@@ -133,6 +133,14 @@ protected function makeSubrequest(GetResponseForExceptionEvent $event, $url, $st
// would execute a subrequest with the 404 route's URL, then it'd be
// generated for *that* URL, not the *original* URL.
$sub_request = clone $request;
// The routing to the 404 page should be done as GET request because it is
// restricted to GET and POST requests only. Otherwise a DELETE request
// would for example trigger a method not allowed exception.
$request_context = clone ($this->accessUnawareRouter->getContext());
$request_context->setMethod('GET');
$this->accessUnawareRouter->setContext($request_context);
$sub_request->attributes->add($this->accessUnawareRouter->match($url));
// Add to query (GET) or request (POST) parameters:
......
......@@ -14,6 +14,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\RequestContext;
/**
* @coversDefaultClass \Drupal\Core\EventSubscriber\CustomPageExceptionHtmlSubscriber
......@@ -127,6 +128,12 @@ protected function tearDown() {
public function testHandleWithPostRequest() {
$request = Request::create('/test', 'POST', array('name' => 'druplicon', 'pass' => '12345'));
$request_context = new RequestContext();
$request_context->fromRequest($request);
$this->accessUnawareRouter->expects($this->any())
->method('getContext')
->willReturn($request_context);
$this->kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
return new HtmlResponse($request->getMethod());
}));
......@@ -148,6 +155,12 @@ public function testHandleWithGetRequest() {
$request = Request::create('/test', 'GET', array('name' => 'druplicon', 'pass' => '12345'));
$request->attributes->set(AccessAwareRouterInterface::ACCESS_RESULT, AccessResult::forbidden()->addCacheTags(['druplicon']));
$request_context = new RequestContext();
$request_context->fromRequest($request);
$this->accessUnawareRouter->expects($this->any())
->method('getContext')
->willReturn($request_context);
$this->kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
return new Response($request->getMethod() . ' ' . UrlHelper::buildQuery($request->query->all()));
}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment