Skip to content
Permalink
Browse files

Adds order to the test models to make the results more predictable.

Even though there was some code in place to prevent results in random
order from PostgreSQL we were still experiencing this with Jenkins
and Travis.

This commit removes the old code that handled this. From now on this
will be handled differently. Every test model will order by its
primary key. You can disable this by changing the order property
of the model to `null`: `$testModel->order = null`.
  • Loading branch information...
Phally committed Jul 19, 2013
1 parent 2f2fba3 commit db1876d837f4e70b5833cbe7d0841173860756a5
@@ -320,6 +320,8 @@ public function testPaginate() {
$Controller->request->query = array();
$Controller->constructClasses();
$Controller->PaginatorControllerPost->order = null;
$Controller->Paginator->settings = array(
'order' => array('PaginatorControllerComment.id' => 'ASC')
);
@@ -62,6 +62,7 @@ class TreeBehaviorAfterTest extends CakeTestCase {
*/
public function testAftersaveCallback() {
$this->Tree = new AfterTree();
$this->Tree->order = null;
$expected = array('AfterTree' => array('name' => 'Six and One Half Changed in AfterTree::afterSave() but not in database', 'parent_id' => 6, 'lft' => 11, 'rght' => 12));
$result = $this->Tree->save(array('AfterTree' => array('name' => 'Six and One Half', 'parent_id' => 6)));
Oops, something went wrong.

0 comments on commit db1876d

Please sign in to comment.
You can’t perform that action at this time.