diff --git a/cake/libs/cache/model.php b/cake/libs/cache/model.php index 3cfcc6b89..7a01ff869 100644 --- a/cake/libs/cache/model.php +++ b/cake/libs/cache/model.php @@ -149,7 +149,7 @@ class ModelEngine extends CacheEngine { * @access public */ function clear() { - return $this->__Model->deleteAll(null); + return $this->__Model->deleteAll('1=1'); } } diff --git a/cake/tests/cases/libs/cache/model.test.php b/cake/tests/cases/libs/cache/model.test.php index 193448180..1d6b4daf0 100644 --- a/cake/tests/cases/libs/cache/model.test.php +++ b/cake/tests/cases/libs/cache/model.test.php @@ -118,6 +118,27 @@ class ModelEngineTest extends CakeTestCase { $this->assertTrue($result); } + function testDeleteAllCache() { + $data = 'this is a test of the emergency broadcasting system'; + $result = Cache::write('delete_test_1', $data); + $this->assertTrue($result); + + $data = 'this is a test of the emergency broadcasting system'; + $result = Cache::write('delete_test_2', $data); + $this->assertTrue($result); + + $data = 'this is a test of the emergency broadcasting system'; + $result = Cache::write('delete_test_3', $data); + $this->assertTrue($result); + + $data = 'this is a test of the emergency broadcasting system'; + $result = Cache::write('delete_test_4', $data); + $this->assertTrue($result); + + $result = Cache::clear(); + $this->assertTrue($result); + } + function tearDown() { Cache::config('default'); }