Skip to content
Permalink
Browse files

Adding tests for Cache not generating errors when Cache.disable = tru…

…e. Refs #286
  • Loading branch information...
markstory committed Feb 13, 2010
1 parent 3f667eb commit 6ccc43d776e5a57d8ca2365f07dc7e4342018ba1
Showing with 21 additions and 4 deletions.
  1. +21 −4 cake/tests/cases/libs/cache.test.php
@@ -68,6 +68,23 @@ function testConfig() {
$this->assertTrue(isset($results['settings']));
}
/**
* Check that no fatal errors are issued doing normal things when Cache.disable is true.
*
* @return void
*/
function testNonFatalErrorsWithCachedisable() {
Configure::write('Cache.disable', true);
Cache::config('test', array('engine' => 'File', 'path' => TMP, 'prefix' => 'error_test_'));
Cache::write('no_save', 'Noooo!', 'test');
Cache::read('no_save', 'test');
Cache::delete('no_save', 'test');
Cache::set('duration', '+10 minutes');
Configure::write('Cache.disable', false);
}
/**
* test configuring CacheEngines in App/libs
*
@@ -157,7 +174,7 @@ function testConfigSettingDefaultConfigKey() {
Cache::config('test_name');
$result = Cache::read('value_one');
$this->assertEqual($result, 'I am cached');
Cache::delete('value_one');
Cache::config('default');
Cache::delete('value_one');
@@ -190,7 +207,7 @@ function testWritingWithConfig() {
}
/**
* test that configured returns an array of the currently configured cache
* test that configured returns an array of the currently configured cache
* settings
*
* @return void
@@ -225,7 +242,7 @@ function testInitSettings() {
}
/**
* test that drop removes cache configs, and that further attempts to use that config
* test that drop removes cache configs, and that further attempts to use that config
* do not work.
*
* @return void
@@ -242,7 +259,7 @@ function testDrop() {
$_testsConfig = Cache::config('tests');
$result = Cache::drop('tests');
$this->assertTrue($result);
Cache::config('unconfigTest', array(
'engine' => 'TestAppCache'
));

0 comments on commit 6ccc43d

Please sign in to comment.
You can’t perform that action at this time.