mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Changing return of Model::deleteAll(). When no records are matched by the delete conditions return is now (bool)true as no records matching those conditions exist.
Test case added. Fixes #6453 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8216 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f79a68b2a6
commit
45a51ed809
2 changed files with 4 additions and 1 deletions
|
@ -1811,7 +1811,7 @@ class Model extends Overloadable {
|
|||
);
|
||||
|
||||
if (empty($ids)) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($callbacks) {
|
||||
|
|
|
@ -7487,6 +7487,9 @@ class ModelTest extends CakeTestCase {
|
|||
'published' => 'Y'
|
||||
)));
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = $TestModel->deleteAll(array('Article.user_id' => 999));
|
||||
$this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s');
|
||||
}
|
||||
/**
|
||||
* testRecursiveDel method
|
||||
|
|
Loading…
Add table
Reference in a new issue