Permalink
Browse files

paginator works with limit 0 now too

  • Loading branch information...
1 parent b4f6dd9 commit 0327f15395f561df4fd2c05af81094bb6d8cfa5a Ernst Mayerhofer committed with markstory Nov 5, 2009
Showing with 7 additions and 0 deletions.
  1. +7 −0 cake/tests/cases/libs/controller/controller.test.php
View
7 cake/tests/cases/libs/controller/controller.test.php
@@ -511,6 +511,13 @@ function testPaginate() {
$Controller->paginate('ControllerPost');
$this->assertIdentical($Controller->params['paging']['ControllerPost']['page'], 1, 'XSS exploit opened %s');
$this->assertIdentical($Controller->params['paging']['ControllerPost']['options']['page'], 1, 'XSS exploit opened %s');
+
+ $Controller->paginate = array('limit' => 0);
+ $Controller->paginate('ControllerPost');
+ $this->assertIdentical($Controller->params['paging']['ControllerPost']['page'], 1);
+ $this->assertIdentical($Controller->params['paging']['ControllerPost']['pageCount'], 1);
+ $this->assertIdentical($Controller->params['paging']['ControllerPost']['prevPage'], false);
+ $this->assertIdentical($Controller->params['paging']['ControllerPost']['nextPage'], false);
}
/**
* testPaginateExtraParams method

0 comments on commit 0327f15

Please sign in to comment.