From 7fef93080122f1f1461e728657f45dbb247a928d Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Mon, 16 Dec 2024 18:43:45 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20loading=20of=20WebProfilerBundle?= =?UTF-8?q?=E2=80=99s=20toolbar=20stylesheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/config/routing/wdt.xml | 2 +- .../Tests/Controller/ProfilerControllerTest.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml index 26bbd96455adf..9f45f1b7490ae 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd"> - + web_profiler.controller.profiler::toolbarStylesheetAction diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php index 3933d30e48dc4..0e0a1e0aae79c 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php @@ -152,15 +152,15 @@ public function testToolbarStylesheetActionWithProfilerDisabled() public function testToolbarStylesheetAction() { - $urlGenerator = $this->createMock(UrlGeneratorInterface::class); - $twig = $this->createMock(Environment::class); - $profiler = $this->createMock(Profiler::class); + $kernel = new WebProfilerBundleKernel(); + $client = new KernelBrowser($kernel); - $controller = new ProfilerController($urlGenerator, $profiler, $twig, []); + $client->request('GET', '/_wdt/styles'); + + $response = $client->getResponse(); - $response = $controller->toolbarStylesheetAction(); $this->assertSame(200, $response->getStatusCode()); - $this->assertSame('text/css', $response->headers->get('Content-Type')); + $this->assertSame('text/css; charset=UTF-8', $response->headers->get('Content-Type')); $this->assertSame('max-age=600, private', $response->headers->get('Cache-Control')); }