"Fixes #3727, ModelEngine::clear() doesn't work"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6215 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-12-23 07:56:36 +00:00
parent 4bad481735
commit 7e17c42e35
2 changed files with 22 additions and 1 deletions

View file

@ -149,7 +149,7 @@ class ModelEngine extends CacheEngine {
* @access public
*/
function clear() {
return $this->__Model->deleteAll(null);
return $this->__Model->deleteAll('1=1');
}
}

View file

@ -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');
}