Add additional test.

This commit is contained in:
euromark 2014-11-05 03:15:43 +01:00
parent dc70da9d14
commit f63d955f73
2 changed files with 11 additions and 2 deletions

View file

@ -1017,6 +1017,16 @@ class PaginatorHelperTest extends CakeTestCase {
);
$this->assertTags($result, $expected);
$result = $this->Paginator->prev('<i class="fa fa-angle-left"></i>', array('escape' => false), null, array('escape' => true));
$expected = array(
'span' => array('class' => 'prev'),
'a' => array('href' => '/', 'rel' => 'prev'),
'&lt;i class=&quot;fa fa-angle-left&quot;&gt;&lt;/i&gt;',
'/a',
'/span'
);
$this->assertTags($result, $expected);
$result = $this->Paginator->prev('<< Previous', null, '<strong>Disabled</strong>');
$expected = array(
'span' => array('class' => 'prev'),

View file

@ -499,8 +499,7 @@ class PaginatorHelper extends AppHelper {
if (!empty($disabledTitle) && $disabledTitle !== true) {
$title = $disabledTitle;
}
$options = (array)$disabledOptions + array_intersect_key($options, array_keys($_defaults)) + $_defaults;
$options = (array)$disabledOptions + array_intersect_key($options, $_defaults) + $_defaults;
} elseif (!$this->{$check}($options['model'])) {
return '';
}