Add test to prove issues with deleteAll with $order set

This commit is contained in:
Rachman Chavik 2013-12-08 16:39:56 +07:00
parent 9aa40819db
commit 98e645a1ea

View file

@ -491,6 +491,33 @@ class ModelDeleteTest extends BaseModelTest {
$this->assertTrue($result); $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 * testRecursiveDel method
* *