Skip to content

Commit 239266e

Browse files
committed
preventing database file from being created in the project repo
1 parent a209ff7 commit 239266e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/Fixtures/AbstractResetPasswordTestKernel.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class AbstractResetPasswordTestKernel extends Kernel
3030
{
3131
use MicroKernelTrait;
3232

33+
private $cacheDir;
34+
35+
private $logDir;
36+
3337
public function __construct()
3438
{
3539
parent::__construct('test', true);
@@ -46,12 +50,20 @@ public function registerBundles()
4650

4751
public function getCacheDir()
4852
{
49-
return \sys_get_temp_dir().'/cache'.\spl_object_hash($this);
53+
if (null === $this->cacheDir) {
54+
return \sys_get_temp_dir().'/cache'.\spl_object_hash($this);
55+
}
56+
57+
return $this->cacheDir;
5058
}
5159

5260
public function getLogDir()
5361
{
54-
return \sys_get_temp_dir().'/logs'.\spl_object_hash($this);
62+
if (null === $this->logDir) {
63+
return \sys_get_temp_dir().'/logs'.\spl_object_hash($this);
64+
}
65+
66+
return $this->logDir;
5567
}
5668

5769
protected function configureRoutes(RoutingConfigurator $routes)
@@ -69,7 +81,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
6981
$container->loadFromExtension('doctrine', [
7082
'dbal' => [
7183
'driver' => 'pdo_sqlite',
72-
'url' => 'sqlite:///fake',
84+
'url' => 'sqlite:///'.$this->getCacheDir().'/app.db',
7385
],
7486
'orm' => [
7587
'auto_generate_proxy_classes' => true,

0 commit comments

Comments
 (0)