diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 3fee720e4..2c8268ea8 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -316,7 +316,7 @@ class PaginatorHelper extends AppHelper { $dir = $this->sortDir($options['model']) === 'asc' ? 'desc' : 'asc'; $class = $dir === 'asc' ? 'desc' : 'asc'; if (!empty($options['class'])) { - $options['class'] .= $class; + $options['class'] .= ' ' . $class; } else { $options['class'] = $class; } diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 9ee145244..398a3e2e2 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -188,7 +188,6 @@ class PaginatorHelperTest extends CakeTestCase { $result = $this->Paginator->sort('title'); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result); - $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('title'); @@ -199,23 +198,25 @@ class PaginatorHelperTest extends CakeTestCase { $result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc')); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result); - $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc')); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:asc" class="desc">Title<\/a>$/', $result); - $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('Title', 'title', array('direction' => 'asc')); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result); - $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc')); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result); + + $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'asc'); + $this->Paginator->params['paging']['Article']['options']['sort'] = null; + $result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc', 'class' => 'foo')); + $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="foo asc">Title<\/a>$/', $result); } /**