Permalink
Browse files

Try to fix random test failures on postgres.

Sorting in postgres is undefined and no based on the primary key when
sorting is not supplied.
  • Loading branch information...
1 parent 84c0de7 commit ceb46b5d2c97e2321de1332e575920195afbfa00 @markstory markstory committed Mar 30, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
@@ -394,9 +394,9 @@ public function testPaginate() {
$this->assertEquals(array(3, 2, 1), $results);
$Controller->request->params['named'] = array('sort' => 'NotExisting.field', 'direction' => 'desc');
- $results = Hash::extract($Controller->Paginator->paginate('PaginatorControllerPost'), '{n}.PaginatorControllerPost.id');
- $this->assertEquals(1, $Controller->params['paging']['PaginatorControllerPost']['page'], 'Invalid field in query %s');
- $this->assertEquals(array(1, 2, 3), $results);
+ $Controller->Paginator->paginate('PaginatorControllerPost');
+ $this->assertEquals(1, $Controller->params['paging']['PaginatorControllerPost']['page']);
+ $this->assertEquals(array(), $Controller->PaginatorControllerPost->lastQueries[1]['order'][0], 'no order should be set.');
$Controller->request->params['named'] = array(
'sort' => 'PaginatorControllerPost.author_id', 'direction' => 'allYourBase'

0 comments on commit ceb46b5

Please sign in to comment.