Skip to content

Commit c1fd862

Browse files
committed
bug symfony#53239 [HttpKernel] fix "Cannot redeclare renderSymfonyLogoSvg()" inside phpunit tests (davidesigner)
This PR was merged into the 7.0 branch. Discussion ---------- [HttpKernel] fix "Cannot redeclare renderSymfonyLogoSvg()" inside phpunit tests | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | N/A | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> In a PHPUnit test case with dataProvider, there was a fatal error: > Compile Error: Cannot redeclare renderSymfonyLogoSvg() (previously declared in /vendor/symfony/http-kernel/Resources/welcome.html.php:219) (500 Internal Server Error) This include_once fix the error. Commits ------- ac97c9b [HttpKernel] fix "Cannot redeclare renderSymfonyLogoSvg()" inside phpunit tests
2 parents 7a634c0 + ac97c9b commit c1fd862

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/EventListener/RouterListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private function createWelcomeResponse(): Response
159159
$docVersion = substr(Kernel::VERSION, 0, 3);
160160

161161
ob_start();
162-
include \dirname(__DIR__).'/Resources/welcome.html.php';
162+
include_once \dirname(__DIR__).'/Resources/welcome.html.php';
163163

164164
return new Response(ob_get_clean(), Response::HTTP_NOT_FOUND);
165165
}

0 commit comments

Comments
 (0)