mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Add test to prove issues with deleteAll with $order set
This commit is contained in:
parent
9aa40819db
commit
98e645a1ea
1 changed files with 27 additions and 0 deletions
|
@ -491,6 +491,33 @@ class ModelDeleteTest extends BaseModelTest {
|
|||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testDeleteAllWithOrderProperty
|
||||
*
|
||||
* Ensure find done in deleteAll works with models that has $order property set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDeleteAllWithOrderProperty() {
|
||||
$this->loadFixtures('Article', 'User');
|
||||
|
||||
$TestModel = new Article();
|
||||
$TestModel->order = 'Article.published desc';
|
||||
$TestModel->unbindModel(array(
|
||||
'belongsTo' => array('User'),
|
||||
'hasMany' => array('Comment'),
|
||||
'hasAndBelongsToMany' => array('Tag')
|
||||
), false);
|
||||
|
||||
$result = $TestModel->deleteAll(
|
||||
array('Article.user_id' => array(1, 3)),
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testRecursiveDel method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue