mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Making tests more accurate to normal use, removing extra params and adding some tests for sortKey. Refs #614
This commit is contained in:
parent
a92b9000bf
commit
215333e56f
1 changed files with 10 additions and 4 deletions
|
@ -45,12 +45,12 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
'nextPage' => true,
|
||||
'pageCount' => 7,
|
||||
'defaults' => array(
|
||||
'order' => 'Article.date ASC',
|
||||
'order' => array('Article.date' => 'asc'),
|
||||
'limit' => 9,
|
||||
'conditions' => array()
|
||||
),
|
||||
'options' => array(
|
||||
'order' => 'Article.date ASC',
|
||||
'order' => array('Article.date' => 'asc'),
|
||||
'limit' => 9,
|
||||
'page' => 1,
|
||||
'conditions' => array()
|
||||
|
@ -134,7 +134,7 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
Router::reload();
|
||||
Router::parse('/');
|
||||
Router::setRequestInfo(array(
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true'), 'bare' => 0),
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0),
|
||||
array('plugin' => null, 'controller' => null, 'action' => null, 'base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/', 'passedArgs' => array())
|
||||
));
|
||||
$this->Paginator->options(array('url' => array('param')));
|
||||
|
@ -305,6 +305,12 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
'order' => array('Article.title' => 'desc'
|
||||
)));
|
||||
$this->assertEqual('Article.title', $result);
|
||||
|
||||
$result = $this->Paginator->sortKey('Article', array('sort' => 'Article.title'));
|
||||
$this->assertEqual($result, 'Article.title');
|
||||
|
||||
$result = $this->Paginator->sortKey('Article', array('sort' => 'Article'));
|
||||
$this->assertEqual($result, 'Article');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue