Making tests more accurate to normal use, removing extra params and adding some tests for sortKey. Refs #614

This commit is contained in:
Mark Story 2010-04-22 22:50:04 -04:00
parent a6f60c1abb
commit 33a38118b6

View file

@ -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()
@ -295,9 +295,15 @@ class PaginatorHelperTest extends CakeTestCase {
*/
function testSortKey() {
$result = $this->Paginator->sortKey(null, array(
'order' => array('Article.title' => 'desc'
'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');
}
/**