From d65e62414e257c679b4507c19cc4ede21e668204 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 6 Apr 2024 17:12:42 +0200 Subject: [PATCH] fix TestKernel --- CHANGELOG.md | 5 +++++ src/HttpKernel/TestKernel.php | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cda5c2..742867f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Changelog 5.x === +5.0.2 +----- + +* Fixed regression in `TestKernel`. + 5.0.1 ----- diff --git a/src/HttpKernel/TestKernel.php b/src/HttpKernel/TestKernel.php index bfc3343..27b7b06 100644 --- a/src/HttpKernel/TestKernel.php +++ b/src/HttpKernel/TestKernel.php @@ -179,7 +179,7 @@ public function getCacheDir(): string public function getLogDir(): string { return implode('/', [ - $this->getKernelDir(), + $this->getProjectDir(), 'var', 'logs', ]); @@ -190,7 +190,7 @@ public function getLogDir(): string */ protected function registerConfiguredBundles(): void { - $bundleFilePath = $this->getKernelDir().'/config/bundles.php'; + $bundleFilePath = $this->getProjectDir().'/config/bundles.php'; if (!file_exists($bundleFilePath)) { return; } @@ -213,8 +213,8 @@ protected function registerConfiguredBundles(): void protected function build(ContainerBuilder $container): void { parent::build($container); - if (\in_array($this->getEnvironment(), ['test', 'phpcr']) && file_exists($this->getKernelDir().'/config/public_services.php')) { - $services = require $this->getKernelDir().'/config/public_services.php'; + if (\in_array($this->getEnvironment(), ['test', 'phpcr']) && file_exists($this->getProjectDir().'/config/public_services.php')) { + $services = require $this->getProjectDir().'/config/public_services.php'; $container->addCompilerPass(new TestContainerPass($services), PassConfig::TYPE_OPTIMIZE); } }