Permalink
Browse files

Fix coding standards and missing doc blocks.

  • Loading branch information...
markstory committed Sep 22, 2013
1 parent 8eb3e15 commit 53337387ad632d3ddddc3092a959376acf334a84
@@ -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;
}
@@ -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;
}
@@ -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', [
@@ -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'];
@@ -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);
}
@@ -14,8 +14,8 @@
*/
namespace Cake\View;
use Cake\Core\Plugin;
use Cake\Configure\Engine\PhpConfig;
use Cake\Core\Plugin;
use Cake\Error;
/**

0 comments on commit 5333738

Please sign in to comment.