Skip to content
Permalink
Browse files

Make sure direction values are lowercased to be consistent.

  • Loading branch information...
dereuromark committed Oct 26, 2015
1 parent a99766c commit 8287981855e3fc69a1148e128697c6dab6c48063
@@ -212,7 +212,7 @@ public function testSortLinks() {
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc');
$this->Paginator->request->params['paging']['Article']['options']['sort'] = null;
$result = $this->Paginator->sort('title', 'Title', array('direction' => 'asc'));
$result = $this->Paginator->sort('title', 'Title', array('direction' => 'ASC'));
$this->assertRegExp('/\/accounts\/index\/param\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result);
$this->Paginator->request->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc');
@@ -351,7 +351,7 @@ public function sort($key, $title = null, $options = array()) {
$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;

0 comments on commit 8287981

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