mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
"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:
parent
4bad481735
commit
7e17c42e35
2 changed files with 22 additions and 1 deletions
2
cake/libs/cache/model.php
vendored
2
cake/libs/cache/model.php
vendored
|
@ -149,7 +149,7 @@ class ModelEngine extends CacheEngine {
|
|||
* @access public
|
||||
*/
|
||||
function clear() {
|
||||
return $this->__Model->deleteAll(null);
|
||||
return $this->__Model->deleteAll('1=1');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
21
cake/tests/cases/libs/cache/model.test.php
vendored
21
cake/tests/cases/libs/cache/model.test.php
vendored
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue