Skip to content
Permalink
Browse files

Make sure direction values are lowercased to be consistent.

  • Loading branch information...
dereuromark committed Oct 27, 2015
1 parent 9d7d63c commit 928c7ca17db6cc70a5075c86f9a57fe8a6827f4d
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/View/Helper/PaginatorHelper.php
  2. +1 −1 tests/TestCase/View/Helper/PaginatorHelperTest.php
@@ -402,7 +402,7 @@ public function sort($key, $title = null, array $options = [])
$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)));
}
$defaultDir = isset($options['direction']) ? $options['direction'] : 'asc';
$defaultDir = isset($options['direction']) ? strtolower($options['direction']) : 'asc';
unset($options['direction']);
$locked = isset($options['lock']) ? $options['lock'] : false;
@@ -233,7 +233,7 @@ public function testSortLinks()
$this->Paginator->request->params['paging']['Article']['sort'] = 'Article.title';
$this->Paginator->request->params['paging']['Article']['direction'] = 'desc';
$result = $this->Paginator->sort('title', 'Title', ['direction' => 'asc']);
$result = $this->Paginator->sort('title', 'Title', ['direction' => 'ASC']);
$expected = [
'a' => ['href' => '/accounts/index/param?sort=title&direction=asc', 'class' => 'desc'],
'Title',

0 comments on commit 928c7ca

Please sign in to comment.
You can’t perform that action at this time.