Skip to content

Commit

Permalink
Making tests more accurate to normal use, removing extra params and a…
Browse files Browse the repository at this point in the history
…dding some tests for sortKey. Refs #614
  • Loading branch information
markstory committed Apr 29, 2010
1 parent a6f60c1 commit 33a3811
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cake/tests/cases/libs/view/helpers/paginator.test.php
Expand Up @@ -45,12 +45,12 @@ function setUp() {
'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()
Expand Down Expand Up @@ -295,9 +295,15 @@ function testSortLinksUsingDotNotation() {
*/
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');
}

/**
Expand Down

0 comments on commit 33a3811

Please sign in to comment.