Skip to content

Commit

Permalink
Fix coding standards and missing doc blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 22, 2013
1 parent 8eb3e15 commit 5333738
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ public function testTemplates() {
* @return void
*/
public function testHasPrevious() {
$this->assertFalse($this->Paginator->hasPrev());
$this->assertSame($this->Paginator->hasPrev(), false);
$this->Paginator->request->params['paging']['Article']['prevPage'] = true;
$this->assertTrue($this->Paginator->hasPrev());
$this->assertSame($this->Paginator->hasPrev(), true);
$this->Paginator->request->params['paging']['Article']['prevPage'] = false;
}

Expand All @@ -113,9 +113,9 @@ public function testHasPrevious() {
* @return void
*/
public function testHasNext() {
$this->assertTrue($this->Paginator->hasNext());
$this->assertSame($this->Paginator->hasNext(), true);
$this->Paginator->request->params['paging']['Article']['nextPage'] = false;
$this->assertFalse($this->Paginator->hasNext());
$this->assertSame($this->Paginator->hasNext(), false);
$this->Paginator->request->params['paging']['Article']['nextPage'] = true;
}

Expand Down Expand Up @@ -914,7 +914,7 @@ public function testNextAndPrevNonDefaultModel() {
$result = $this->Paginator->prev('Prev', [
'model' => 'Client'
]);
$expected ='<li class="prev disabled"><span>Prev</span></li>';
$expected = '<li class="prev disabled"><span>Prev</span></li>';
$this->assertEquals($expected, $result);

$result = $this->Paginator->next('Next', [
Expand Down
8 changes: 7 additions & 1 deletion Cake/View/Helper/PaginatorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ public function sortDir($model = null, $options = array()) {

/**
* Generate an active/inactive link for next/prev methods.
*
* @param string $text The enabled text for the link.
* @param boolean $enabled Whether or not the enabled/disabled version should be created.
* @param array $options An array of options from the calling method.
* @param array $templates An array of templates with the 'active' and 'disabled' keys.
* @return string Generated HTML
*/
protected function _toggledLink($text, $enabled, $options, $templates) {
$template = $templates['active'];
Expand Down Expand Up @@ -312,7 +318,7 @@ public function prev($title = '<< Previous', $options = []) {
$enabled = $this->hasPrev($options['model']);
$templates = [
'active' => 'prevActive',
'disabled' => 'prevDisabled'
'disabled' => 'prevDisabled'
];
return $this->_toggledLink($title, $enabled, $options, $templates);
}
Expand Down
2 changes: 1 addition & 1 deletion Cake/View/StringTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/
namespace Cake\View;

use Cake\Core\Plugin;
use Cake\Configure\Engine\PhpConfig;
use Cake\Core\Plugin;
use Cake\Error;

/**
Expand Down

0 comments on commit 5333738

Please sign in to comment.