Making paging params match those that would be generated by PaginatorComponent.

This commit is contained in:
mark_story 2010-12-19 13:09:52 -05:00
parent 8c3ceff50d
commit 176d5520f6

View file

@ -53,8 +53,6 @@ class PaginatorHelperTest extends CakeTestCase {
'nextPage' => true,
'pageCount' => 7,
'options' => array(
'order' => array('Article.date' => 'asc'),
'limit' => 9,
'page' => 1,
'conditions' => array()
)
@ -138,6 +136,21 @@ class PaginatorHelperTest extends CakeTestCase {
array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/')
));
$this->Paginator->options(array('url' => array('param')));
$this->Paginator->request['paging'] = array(
'Article' => array(
'current' => 9,
'count' => 62,
'prevPage' => false,
'nextPage' => true,
'pageCount' => 7,
'options' => array(
'page' => 1,
'order' => array('date' => 'asc'),
'conditions' => array()
)
)
);
$result = $this->Paginator->sort('title');
$expected = array(
'a' => array('href' => '/officespace/accounts/index/param/page:1/sort:title/direction:asc'),
@ -645,7 +658,9 @@ class PaginatorHelperTest extends CakeTestCase {
'page' => 1, 'current' => 3, 'count' => 13,
'prevPage' => false, 'nextPage' => true, 'pageCount' => 8,
'options' => array(
'page' => 1, 'limit' => 3, 'order' => array(), 'conditions' => array()
'page' => 1,
'order' => array(),
'conditions' => array()
)
)
);
@ -708,9 +723,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 5,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -792,9 +804,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 5,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -835,7 +844,6 @@ class PaginatorHelperTest extends CakeTestCase {
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -926,7 +934,7 @@ class PaginatorHelperTest extends CakeTestCase {
'nextPage' => true,
'pageCount' => 5,
'options' => array(
'page' => 1, 'limit' => 3, 'order' => array('Client.name' => 'DESC'), 'conditions' => array()
'page' => 1,
)
)
);
@ -969,9 +977,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 5,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
),
'Server' => array(
@ -983,9 +988,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 5,
'options' => array(
'page' => 1,
'limit' => 5,
'order' => array('Server.name' => 'ASC'),
'conditions' => array()
)
)
);
@ -1095,9 +1097,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1195,9 +1194,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1234,9 +1230,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1272,9 +1265,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 9,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1333,9 +1323,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1375,9 +1362,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1418,9 +1402,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 42,
'options' => array(
'page' => 6,
'limit' => 15,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1461,9 +1442,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 42,
'options' => array(
'page' => 37,
'limit' => 15,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1502,17 +1480,8 @@ class PaginatorHelperTest extends CakeTestCase {
'prevPage' => false,
'nextPage' => 2,
'pageCount' => 3,
'defaults' => array(
'limit' => 3,
'step' => 1,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
),
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1538,7 +1507,6 @@ class PaginatorHelperTest extends CakeTestCase {
'options' => array(
'page' => 1,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1565,9 +1533,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 4897,
'options' => array(
'page' => 4894,
'limit' => 10,
'order' => 'Client.name DESC',
'conditions' => array()
)
)
);
@ -1791,12 +1756,7 @@ class PaginatorHelperTest extends CakeTestCase {
'prevPage' => false,
'nextPage' => 2,
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
'options' => array()
)
);
@ -1814,9 +1774,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1898,9 +1855,6 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -1918,9 +1872,7 @@ class PaginatorHelperTest extends CakeTestCase {
'pageCount' => 15,
'options' => array(
'page' => 1,
'limit' => 3,
'order' => array('Client.name' => 'DESC'),
'conditions' => array()
)
)
);
@ -2139,7 +2091,7 @@ class PaginatorHelperTest extends CakeTestCase {
Router::reload();
Router::parse('/');
Router::setRequestInfo(array(
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true')),
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'url' => array('url' => 'accounts/')),
array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/', 'passedArgs' => array())
));