Skip to content

Commit

Permalink
fix TestKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Apr 6, 2024
1 parent 4c0c16c commit d65e624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog
5.x
===

5.0.2
-----

* Fixed regression in `TestKernel`.

5.0.1
-----

Expand Down
8 changes: 4 additions & 4 deletions src/HttpKernel/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function getCacheDir(): string
public function getLogDir(): string
{
return implode('/', [
$this->getKernelDir(),
$this->getProjectDir(),
'var',
'logs',
]);
Expand All @@ -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;
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit d65e624

Please sign in to comment.