Skip to content

Commit

Permalink
Test case for loooong page numbers in paginated results seems to caus…
Browse files Browse the repository at this point in the history
…e SQL error
  • Loading branch information
robmcvey committed May 2, 2013
1 parent df8f5e8 commit bd3be28
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
Expand Up @@ -889,6 +889,24 @@ public function testOutOfRangePageNumberGetsClamped() {
$Controller->Paginator->paginate('PaginatorControllerPost');
}

/**
* Test that a really REALLY large page number gets clamped to the max page size.
*
*
* @expectedException NotFoundException
* @return void
*/
public function testOutOfVeryBigRangePageNumberGetsClamped() {
$Controller = new PaginatorTestController($this->request);
$Controller->uses = array('PaginatorControllerPost');
$Controller->params['named'] = array(
'page' => 3000000000000000000000000,
);
$Controller->constructClasses();
$Controller->PaginatorControllerPost->recursive = 0;
$Controller->Paginator->paginate('PaginatorControllerPost');
}

/**
* testOutOfRangePageNumberAndPageCountZero
*
Expand Down

0 comments on commit bd3be28

Please sign in to comment.