Skip to content

Commit

Permalink
better cache config testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed Dec 18, 2013
1 parent 9d866c8 commit da2824f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/ProjectKernel.php
Expand Up @@ -126,12 +126,6 @@ public function __invoke()
public function cacheConfig($stage)
{
$file = $this->getCacheConfigFile($stage);
if (file_exists($file)) {
$this->addDebug("Cache config: unlink $file");
unlink($file);
} else {
$this->addDebug("Cache config: no file $file");
}

$dir = dirname($file);
if (! is_dir($dir)) {
Expand Down
18 changes: 16 additions & 2 deletions tests/integration/ProjectKernelTest.php
Expand Up @@ -24,16 +24,30 @@ protected function setUp()
$env['AURA_CONFIG_MODE'] = 'integration';
$base = $this->getBase();
$this->project_kernel = ProjectKernelFactory::newInstance($base, $env);

$this->cache_define = "{$base}/tmp/cache/config/integration/define.php";
$this->cache_modify = "{$base}/tmp/cache/config/integration/modify.php";
$this->clearCacheConfig();
}

protected function tearDown()
{
$this->clearCacheConfig();
}

protected function clearCacheConfig()
{
if (file_exists($this->cache_define)) {
unlink($this->cache_define);
}

$this->cache_modify = "{$base}/tmp/cache/config/integration/modify.php";
if (file_exists($this->cache_modify)) {
unlink($this->cache_modify);
}

$cache_dir = dirname($this->cache_modify);
if (is_dir($cache_dir)) {
rmdir($cache_dir);
}
}

public function test__invoke()
Expand Down

0 comments on commit da2824f

Please sign in to comment.