From 0d39f2d97e3ef74a8479dcedf736bbebdcfcf73b Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 16 Sep 2013 23:17:05 -0400 Subject: [PATCH] Remove options key in PaginatorHelper tests. It has been removed in the component. Make the PaginatorHelper test setup match the new reality. --- .../View/Helper/PaginatorHelperTest.php | 272 ++++++------------ 1 file changed, 84 insertions(+), 188 deletions(-) diff --git a/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php b/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php index c7abb3628b0..1543c57c33b 100644 --- a/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php +++ b/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php @@ -1,7 +1,5 @@ @@ -13,7 +11,6 @@ * * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests - * @package Cake.Test.Case.View.Helper * @since CakePHP(tm) v 1.2.0.4206 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ @@ -32,7 +29,6 @@ /** * PaginatorHelperTest class * - * @package Cake.Test.Case.View.Helper */ class PaginatorHelperTest extends TestCase { @@ -52,7 +48,7 @@ public function setUp() { $this->Paginator->request->addParams(array( 'paging' => array( 'Article' => array( - 'page' => 2, + 'page' => 1, 'current' => 9, 'count' => 62, 'prevPage' => false, @@ -60,10 +56,6 @@ public function setUp() { 'pageCount' => 7, 'order' => null, 'limit' => 20, - 'options' => array( - 'page' => 1, - 'conditions' => array() - ), ) ) )); @@ -148,11 +140,9 @@ public function testSortLinks() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 7, - 'options' => array( - 'page' => 1, - 'order' => array('date' => 'asc'), - 'conditions' => array() - ), + 'sort' => 'date', + 'direction' => 'asc', + 'page' => 1, ) ); @@ -188,7 +178,7 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = 'title'; + $this->Paginator->request->params['paging']['Article']['sort'] = 'title'; $result = $this->Paginator->sort('title', array('asc' => 'ascending', 'desc' => 'descending')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=desc', 'class' => 'asc'), @@ -197,8 +187,8 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('title'); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=asc', 'class' => 'desc'), @@ -207,8 +197,8 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sort('title'); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=desc', 'class' => 'asc'), @@ -217,8 +207,8 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('title', 'Title', array('direction' => 'desc')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=asc', 'class' => 'desc'), @@ -227,8 +217,8 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('title', 'Title', array('direction' => 'asc')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=asc', 'class' => 'desc'), @@ -237,8 +227,8 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['sort'] = 'asc'; $result = $this->Paginator->sort('title', 'Title', array('direction' => 'asc')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=desc', 'class' => 'asc'), @@ -247,8 +237,9 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; + $result = $this->Paginator->sort('title', 'Title', array('direction' => 'desc')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=desc', 'class' => 'asc'), @@ -257,8 +248,9 @@ public function testSortLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); - $this->Paginator->request->params['paging']['Article']['options']['sort'] = null; + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; + $result = $this->Paginator->sort('title', 'Title', array('direction' => 'desc', 'class' => 'foo')); $expected = array( 'a' => array('href' => '/accounts/index/param?sort=title&direction=desc', 'class' => 'foo asc'), @@ -278,7 +270,8 @@ public function testSortLinkWithVirtualField() { array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/')), array('base' => '', 'here' => '/accounts/', 'webroot' => '/') )); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('full_name' => 'asc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'full_name'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sort('Article.full_name'); $expected = array( @@ -296,7 +289,8 @@ public function testSortLinkWithVirtualField() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('full_name' => 'desc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'full_name'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('Article.full_name'); $expected = array( 'a' => array('href' => '/accounts/index?sort=Article.full_name&direction=asc', 'class' => 'desc'), @@ -355,7 +349,8 @@ public function testSortLinksUsingDotNotation() { array('base' => '', 'here' => '/accounts/', 'webroot' => '/') )); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('Article.title'); $expected = array( 'a' => array('href' => '/accounts/index?sort=Article.title&direction=asc', 'class' => 'desc'), @@ -364,7 +359,8 @@ public function testSortLinksUsingDotNotation() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sort('Article.title', 'Title'); $expected = array( 'a' => array('href' => '/accounts/index?sort=Article.title&direction=asc', 'class' => 'desc'), @@ -373,7 +369,8 @@ public function testSortLinksUsingDotNotation() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sort('Article.title', 'Title'); $expected = array( 'a' => array('href' => '/accounts/index?sort=Article.title&direction=desc', 'class' => 'asc'), @@ -382,7 +379,8 @@ public function testSortLinksUsingDotNotation() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Account.title' => 'asc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Account.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sort('title'); $expected = array( 'a' => array('href' => '/accounts/index?sort=title&direction=asc'), @@ -445,65 +443,37 @@ public function testSortKeyFallbackToParams() { public function testSortDir() { $result = $this->Paginator->sortDir(); $expected = 'asc'; - $this->assertEquals($expected, $result); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sortDir(); - $expected = 'desc'; - - $this->assertEquals($expected, $result); - - unset($this->Paginator->request->params['paging']['Article']['options']); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); - $result = $this->Paginator->sortDir(); - $expected = 'asc'; - - $this->assertEquals($expected, $result); - - unset($this->Paginator->request->params['paging']['Article']['options']); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('title' => 'desc'); - $result = $this->Paginator->sortDir(); - $expected = 'desc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('desc', $result); - unset($this->Paginator->request->params['paging']['Article']['options']); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('title' => 'asc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sortDir(); - $expected = 'asc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('asc', $result); - unset($this->Paginator->request->params['paging']['Article']['options']); - $this->Paginator->request->params['paging']['Article']['options']['direction'] = 'asc'; + $this->Paginator->request->params['paging']['Article']['sort'] = 'title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'desc'; $result = $this->Paginator->sortDir(); - $expected = 'asc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('desc', $result); - unset($this->Paginator->request->params['paging']['Article']['options']); - $this->Paginator->request->params['paging']['Article']['options']['direction'] = 'desc'; + $this->Paginator->request->params['paging']['Article']['sort'] = 'title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $result = $this->Paginator->sortDir(); - $expected = 'desc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('asc', $result); - unset($this->Paginator->request->params['paging']['Article']['options']); + unset($this->Paginator->request->params['paging']['Article']['direction']); $result = $this->Paginator->sortDir('Article', array('direction' => 'asc')); - $expected = 'asc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('asc', $result); $result = $this->Paginator->sortDir('Article', array('direction' => 'desc')); - $expected = 'desc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('desc', $result); $result = $this->Paginator->sortDir('Article', array('direction' => 'asc')); - $expected = 'asc'; - - $this->assertEquals($expected, $result); + $this->assertEquals('asc', $result); } /** @@ -513,18 +483,18 @@ public function testSortDir() { * @return void */ public function testSortDirFallbackToParams() { - $this->Paginator->request->params['paging']['Article']['order'] = array( - 'Article.body' => 'ASC' - ); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.body'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; + $result = $this->Paginator->sortDir(); $this->assertEquals('asc', $result); $result = $this->Paginator->sortDir('Article'); $this->assertEquals('asc', $result); - $this->Paginator->request->params['paging']['Article']['order'] = array( - 'Article.body' => 'DESC' - ); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.body'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'DESC'; + $result = $this->Paginator->sortDir(); $this->assertEquals('desc', $result); @@ -592,16 +562,16 @@ public function testUrlGeneration() { $result = $this->Paginator->url(); $this->assertEquals('/index', $result); - $this->Paginator->request->params['paging']['Article']['options']['page'] = 2; + $this->Paginator->request->params['paging']['Article']['page'] = 2; $result = $this->Paginator->url(); $this->assertEquals('/index?page=2', $result); - $options = array('order' => array('Article' => 'desc')); + $options = array('sort' => 'Article', 'direction' => 'desc'); $result = $this->Paginator->url($options); $this->assertEquals('/index?page=2&sort=Article&direction=desc', $result); - $this->Paginator->request->params['paging']['Article']['options']['page'] = 3; - $options = array('order' => array('Article.name' => 'desc')); + $this->Paginator->request->params['paging']['Article']['page'] = 3; + $options = array('sort' => 'Article.name', 'direction' => 'desc'); $result = $this->Paginator->url($options); $this->assertEquals('/index?page=3&sort=Article.name&direction=desc', $result); } @@ -622,7 +592,6 @@ public function testUrlGenerationWithPrefixes() { array('base' => '', 'here' => 'posts/index', 'webroot' => '/') )); - $this->Paginator->request->params['paging']['Article']['options']['page'] = 2; $this->Paginator->request->params['paging']['Article']['page'] = 2; $this->Paginator->request->params['paging']['Article']['prevPage'] = true; $options = array('prefix' => 'members'); @@ -659,12 +628,12 @@ public function testUrlGenerationWithPrefixes() { ); $this->assertTags($result, $expected); - $options = array('prefix' => 'members', 'controller' => 'posts', 'order' => array('name' => 'desc')); + $options = array('prefix' => 'members', 'controller' => 'posts', 'sort' => 'name', 'direction' => 'desc'); $result = $this->Paginator->url($options); $expected = '/members/posts/index?page=2&sort=name&direction=desc'; $this->assertEquals($expected, $result); - $options = array('controller' => 'posts', 'order' => array('Article.name' => 'desc')); + $options = array('controller' => 'posts', 'sort' => 'Article.name', 'direction' => 'desc'); $result = $this->Paginator->url($options); $expected = '/posts/index?page=2&sort=Article.name&direction=desc'; $this->assertEquals($expected, $result); @@ -680,13 +649,13 @@ public function testOptions() { $this->Paginator->request->params = array(); $options = array('paging' => array('Article' => array( - 'order' => 'desc', + 'direction' => 'desc', 'sort' => 'title' ))); $this->Paginator->options($options); $expected = array('Article' => array( - 'order' => 'desc', + 'direction' => 'desc', 'sort' => 'title' )); $this->assertEquals($expected, $this->Paginator->request->params['paging']); @@ -695,20 +664,20 @@ public function testOptions() { $this->Paginator->request->params = array(); $options = array('Article' => array( - 'order' => 'desc', + 'direction' => 'desc', 'sort' => 'title' )); $this->Paginator->options($options); $this->assertEquals($expected, $this->Paginator->request->params['paging']); $options = array('paging' => array('Article' => array( - 'order' => 'desc', + 'direction' => 'desc', 'sort' => 'Article.title' ))); $this->Paginator->options($options); $expected = array('Article' => array( - 'order' => 'desc', + 'direction' => 'desc', 'sort' => 'Article.title' )); $this->assertEquals($expected, $this->Paginator->request->params['paging']); @@ -728,11 +697,7 @@ public function testPassedArgsMergingWithUrlOptions() { 'Article' => array( 'page' => 1, 'current' => 3, 'count' => 13, 'prevPage' => false, 'nextPage' => true, 'pageCount' => 8, - 'options' => array( - 'page' => 1, - 'order' => array(), - 'conditions' => array() - ), + 'sort' => null, 'direction' => null, ) ); @@ -791,9 +756,6 @@ public function testPagingLinks() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled')); @@ -903,9 +865,6 @@ public function testPagingLinks() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - ), ) ); @@ -976,11 +935,9 @@ public function testPagingLinks() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - 'limit' => 3, - 'order' => array('Client.name' => 'DESC'), - ), + 'sort' => 'Client.name', + 'direction' => 'DESC', + 'limit' => 3, ) ); @@ -1020,12 +977,7 @@ public function testPagingLinks() { 'prevPage' => true, 'nextPage' => false, 'pageCount' => 2, - 'options' => array( - 'page' => 2, - 'limit' => 10, - 'order' => array(), - 'conditions' => array() - ), + 'limit' => 10, ) ); $result = $this->Paginator->prev('Prev'); @@ -1050,10 +1002,7 @@ public function testPagingLinks() { 'Client' => array( 'page' => 2, 'current' => 1, 'count' => 13, 'prevPage' => true, 'nextPage' => false, 'pageCount' => 2, - 'defaults' => array(), - 'options' => array( - 'page' => 2, 'limit' => 10, 'order' => array(), 'conditions' => array() - ), + 'limit' => 10, ) ); $this->Paginator->options(array('url' => array(12, 'page' => 3))); @@ -1083,9 +1032,6 @@ public function testPagingLinksOptionsReplaceEmptyDisabledOptions() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->prev('<< Previous', array('escape' => false)); @@ -1124,9 +1070,6 @@ public function testPagingLinksNotDefaultModel() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - ), ), 'Server' => array( 'page' => 1, @@ -1135,9 +1078,6 @@ public function testPagingLinksNotDefaultModel() { 'prevPage' => false, 'nextPage' => false, 'pageCount' => 5, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->next('Next', array('model' => 'Client')); @@ -1171,7 +1111,7 @@ public function testGenericLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['page'] = 2; + $this->Paginator->request->params['paging']['Article']['page'] = 2; $result = $this->Paginator->link('Sort by title', array('sort' => 'title', 'direction' => 'desc')); $expected = array( 'a' => array('href' => '/index?page=2&sort=title&direction=desc'), @@ -1180,7 +1120,7 @@ public function testGenericLinks() { ); $this->assertTags($result, $expected); - $this->Paginator->request->params['paging']['Article']['options']['page'] = 4; + $this->Paginator->request->params['paging']['Article']['page'] = 4; $result = $this->Paginator->link('Sort by title on page 4', array('sort' => 'Article.title', 'direction' => 'desc')); $expected = array( 'a' => array('href' => '/index?page=4&sort=Article.title&direction=desc'), @@ -1241,9 +1181,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->numbers(); @@ -1338,9 +1275,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->numbers(); @@ -1373,9 +1307,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - ), ) ); $result = $this->Paginator->numbers(); @@ -1408,9 +1339,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 9, - 'options' => array( - 'page' => 1, - ), ) ); @@ -1532,9 +1460,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - ), ) ); @@ -1571,9 +1496,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - ), ) ); @@ -1611,9 +1533,6 @@ public function testNumbers() { 'prevPage' => 1, 'nextPage' => 1, 'pageCount' => 42, - 'options' => array( - 'page' => 6, - ), ) ); @@ -1651,9 +1570,6 @@ public function testNumbers() { 'prevPage' => 1, 'nextPage' => 1, 'pageCount' => 42, - 'options' => array( - 'page' => 37, - ), ) ); @@ -1691,9 +1607,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 3, - 'options' => array( - 'page' => 1, - ), ) ); $options = array('modulus' => 10); @@ -1725,10 +1638,8 @@ public function testNumbers() { 'prevPage' => true, 'nextPage' => true, 'pageCount' => 4, - 'options' => array( - 'page' => 1, - 'order' => array('Client.name' => 'DESC'), - ), + 'sort' => 'Client.name', + 'direction' => 'DESC', ) ); $result = $this->Paginator->numbers(array('class' => 'page-link')); @@ -1751,9 +1662,6 @@ public function testNumbers() { 'prevPage' => 1, 'nextPage' => 1, 'pageCount' => 4897, - 'options' => array( - 'page' => 4894, - ), ) ); @@ -1968,9 +1876,6 @@ public function testNumbers() { 'prevPage' => false, 'nextPage' => 3, 'pageCount' => 3, - 'options' => array( - 'page' => 1, - ) ) ); @@ -2058,7 +1963,8 @@ public function testFirstEmpty() { * @return void */ public function testFirstFullBaseUrl() { - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'DESC'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'DESC'; $this->Paginator->options(array('url' => array('_full' => true))); @@ -2192,10 +2098,8 @@ public function testLastOptions() { 'prevPage' => false, 'nextPage' => 2, 'pageCount' => 15, - 'options' => array( - 'page' => 1, - 'order' => array('Client.name' => 'DESC'), - ), + 'sort' => 'Client.name', + 'direction' => 'DESC', ) ); @@ -2262,10 +2166,8 @@ public function testCounter() { 'nextPage' => true, 'pageCount' => 5, 'limit' => 3, - 'options' => array( - 'page' => 1, - 'order' => array('Client.name' => 'DESC'), - ), + 'sort' => 'Client.name', + 'order' => 'DESC', ) ); $input = 'Page %page% of %pages%, showing %current% records out of %count% total, '; @@ -2380,7 +2282,8 @@ public function testNextLinkUsingDotNotation() { array('base' => '', 'here' => '/accounts/', 'webroot' => '/') )); - $this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); + $this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title'; + $this->Paginator->request->params['paging']['Article']['direction'] = 'asc'; $this->Paginator->request->params['paging']['Article']['page'] = 1; $test = array('url' => array( @@ -2441,9 +2344,6 @@ public function testWithOnePage() { 'prevPage' => false, 'nextPage' => true, 'pageCount' => 1, - 'options' => array( - 'page' => 1, - ), ) ); $this->assertFalse($this->Paginator->numbers()); @@ -2466,10 +2366,6 @@ public function testWithZeroPages() { 'nextPage' => false, 'pageCount' => 0, 'limit' => 10, - 'options' => array( - 'page' => 0, - 'conditions' => array() - ), ) );