Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…e. Refs #286
  • Loading branch information...
commit 6ccc43d776e5a57d8ca2365f07dc7e4342018ba1 1 parent 3f667eb
@markstory markstory authored
Showing with 21 additions and 4 deletions.
  1. +21 −4 cake/tests/cases/libs/cache.test.php
View
25 cake/tests/cases/libs/cache.test.php
@@ -69,6 +69,23 @@ function testConfig() {
}
/**
+ * 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
*
* @return void
@@ -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'
));
Please sign in to comment.
Something went wrong with that request. Please try again.