Browse files

Test case for loooong page numbers in paginated results seems to caus…

…e SQL error
  • Loading branch information...
1 parent df8f5e8 commit bd3be2877d918ad88dbf4f2ef8926b894b77aa2e @robmcvey robmcvey committed May 2, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
View
18 lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php
@@ -890,6 +890,24 @@ public function testOutOfRangePageNumberGetsClamped() {
}
/**
+ * 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
*
* @return void

0 comments on commit bd3be28

Please sign in to comment.