Skip to content

Commit

Permalink
Add test verifying you can disable cache fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Jan 23, 2018
1 parent f8a1cdc commit 21f088e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/TestCase/Cache/CacheTest.php
Expand Up @@ -96,6 +96,27 @@ public function testCacheEngineFallback()
unlink($filename);
}

/**
* tests you can disable Cache::engine() fallback
*
* @return void
*/
public function testCacheEngineFallbackDisabled()
{
$this->expectException(Error::class);

$filename = tempnam(TMP, 'tmp_');

Cache::setConfig('tests', [
'engine' => 'File',
'path' => $filename,
'prefix' => 'test_',
'fallback' => false
]);

$engine = Cache::engine('tests');
}

/**
* tests handling misconfiguration of fallback
*
Expand Down

0 comments on commit 21f088e

Please sign in to comment.