Skip to content

Commit

Permalink
preventing database file from being created in the project repo
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Mar 27, 2020
1 parent a209ff7 commit 239266e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/Fixtures/AbstractResetPasswordTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class AbstractResetPasswordTestKernel extends Kernel
{
use MicroKernelTrait;

private $cacheDir;

private $logDir;

public function __construct()
{
parent::__construct('test', true);
Expand All @@ -46,12 +50,20 @@ public function registerBundles()

public function getCacheDir()
{
return \sys_get_temp_dir().'/cache'.\spl_object_hash($this);
if (null === $this->cacheDir) {
return \sys_get_temp_dir().'/cache'.\spl_object_hash($this);
}

return $this->cacheDir;
}

public function getLogDir()
{
return \sys_get_temp_dir().'/logs'.\spl_object_hash($this);
if (null === $this->logDir) {
return \sys_get_temp_dir().'/logs'.\spl_object_hash($this);
}

return $this->logDir;
}

protected function configureRoutes(RoutingConfigurator $routes)
Expand All @@ -69,7 +81,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$container->loadFromExtension('doctrine', [
'dbal' => [
'driver' => 'pdo_sqlite',
'url' => 'sqlite:///fake',
'url' => 'sqlite:///'.$this->getCacheDir().'/app.db',
],
'orm' => [
'auto_generate_proxy_classes' => true,
Expand Down

0 comments on commit 239266e

Please sign in to comment.