Skip to content

Commit

Permalink
Made cache engine fallback test more predictable across servers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyharris committed Jun 8, 2017
1 parent 1d81bf0 commit 6e9f97f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/TestCase/Cache/CacheTest.php
Expand Up @@ -71,9 +71,11 @@ protected function _configCache()
*/
public function testCacheEngineFallback()
{
$filename = tempnam(TMP, 'tmp_');

Cache::setConfig('tests', [
'engine' => 'File',
'path' => DS . 'missing_dir',
'path' => $filename,
'prefix' => 'test_',
'fallback' => 'tests_fallback'
]);
Expand All @@ -89,6 +91,7 @@ public function testCacheEngineFallback()

Cache::drop('tests');
Cache::drop('tests_fallback');
unlink($filename);
}

/**
Expand All @@ -98,15 +101,17 @@ public function testCacheEngineFallback()
*/
public function testCacheFallbackIntegration()
{
$filename = tempnam(TMP, 'tmp_');

Cache::setConfig('tests', [
'engine' => 'File',
'path' => DS . 'unwritable_dir',
'path' => $filename,
'prefix' => 'test_',
'fallback' => 'tests_fallback',
]);
Cache::setConfig('tests_fallback', [
'engine' => 'File',
'path' => DS . 'still_unwritable_dir',
'path' => $filename,
'prefix' => 'test_',
'fallback' => 'tests_fallback_final',
]);
Expand All @@ -123,6 +128,7 @@ public function testCacheFallbackIntegration()
Cache::drop('tests');
Cache::drop('tests_fallback');
Cache::drop('tests_fallback_final');
unlink($filename);
}

/**
Expand Down

0 comments on commit 6e9f97f

Please sign in to comment.