mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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.
This commit is contained in:
parent
84c0de7e2d
commit
ceb46b5d2c
1 changed files with 3 additions and 3 deletions
|
@ -394,9 +394,9 @@ class PaginatorComponentTest extends CakeTestCase {
|
|||
$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'
|
||||
|
|
Loading…
Add table
Reference in a new issue