Skip to content

Commit ef4b8b4

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: fix tests using Twig 3.12 skip tests requiring the intl extension if it's not installed 🐛 throw ParseException on invalid date [ExpressionLanguage] Improve test coverage [HttpKernel] [WebProfileBundle] Fix Routing panel for URLs with a colon [Form] NumberType: Fix parsing of numbers in exponential notation with negative exponent [Security] consistent singular/plural translation in Dutch reset the validation context after validating nested constraints do not duplicate directory separators fix handling empty data in ValueToDuplicatesTransformer [Validator] review latvian translations [Validator] Add Dutch translation for `WordCount` constraint allow more unicode characters in URL paths [String][EnglishInflector] Fix words ending in 'le', e.g., articles do not duplicate directory separators [Uid] Ensure UuidV1 is created in lowercase
2 parents 370c9f1 + 8f1628f commit ef4b8b4

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

Controller/RouterController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ public function panelAction(string $token): Response
8383
*/
8484
private function getTraces(RequestDataCollector $request, string $method): array
8585
{
86-
$traceRequest = Request::create(
87-
$request->getPathInfo(),
88-
$request->getRequestServer(true)->get('REQUEST_METHOD'),
89-
\in_array($request->getMethod(), ['DELETE', 'PATCH', 'POST', 'PUT'], true) ? $request->getRequestRequest()->all() : $request->getRequestQuery()->all(),
86+
$traceRequest = new Request(
87+
$request->getRequestQuery()->all(),
88+
$request->getRequestRequest()->all(),
89+
$request->getRequestAttributes()->all(),
9090
$request->getRequestCookies(true)->all(),
9191
[],
9292
$request->getRequestServer(true)->all()
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller;
13+
14+
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
15+
use Symfony\Bundle\FrameworkBundle\Routing\Router;
16+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
17+
use Symfony\Bundle\WebProfilerBundle\Tests\Functional\WebProfilerBundleKernel;
18+
use Symfony\Component\DomCrawler\Crawler;
19+
use Symfony\Component\Routing\Route;
20+
21+
class RouterControllerTest extends WebTestCase
22+
{
23+
public function testFalseNegativeTrace()
24+
{
25+
$path = '/foo/bar:123/baz';
26+
27+
$kernel = new WebProfilerBundleKernel();
28+
$client = new KernelBrowser($kernel);
29+
$client->disableReboot();
30+
$client->getKernel()->boot();
31+
32+
/** @var Router $router */
33+
$router = $client->getContainer()->get('router');
34+
$router->getRouteCollection()->add('route1', new Route($path));
35+
36+
$client->request('GET', $path);
37+
38+
$crawler = $client->request('GET', '/_profiler/latest?panel=router&type=request');
39+
40+
$matchedRouteCell = $crawler
41+
->filter('#router-logs .status-success td')
42+
->reduce(function (Crawler $td) use ($path): bool {
43+
return $td->text() === $path;
44+
});
45+
46+
$this->assertSame(1, $matchedRouteCell->count());
47+
}
48+
}

0 commit comments

Comments
 (0)