Skip to content

Commit 7e9948b

Browse files
authored
Merge pull request #372 from norkunas/fix-share-dir
Fix `kernel.share_dir`
2 parents d797ec8 + 1c24147 commit 7e9948b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Functional/CustomTestKernel.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ public function getCacheDir(): string
4545
return realpath(sys_get_temp_dir()).'/NyholmBundleTest/cachePluginInteractionTest';
4646
}
4747

48+
public function getShareDir(): ?string
49+
{
50+
return $this->getCacheDir();
51+
}
52+
4853
/**
4954
* Returns the kernel parameters.
5055
*/
@@ -77,8 +82,7 @@ protected function getKernelParameters(): array
7782
'kernel.bundles_metadata' => $bundlesMetadata,
7883
'kernel.charset' => $this->getCharset(),
7984
'kernel.container_class' => $this->getContainerClass(),
80-
'kernel.share_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
81-
];
85+
] + (null !== ($dir = $this->getShareDir()) ? ['kernel.share_dir' => realpath($dir) ?: $dir] : []);
8286
}
8387

8488
/**

0 commit comments

Comments
 (0)