Skip to content

Commit bb1fa0d

Browse files
committed
Merge pull request #67 from deizel/disabled-title
Update next/prev links to respect disable title and escape options
2 parents 361789c + 87907ee commit bb1fa0d

File tree

6 files changed

+177
-17
lines changed

6 files changed

+177
-17
lines changed

Controller/BoostCakeController.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class BoostCakeController extends AppController {
1414
);
1515

1616
/**
17-
* beforeFilter
17+
* Before filter
18+
*
1819
* @throws MethodNotAllowedException
20+
* @return void
1921
*/
2022
public function beforeFilter() {
2123
if (Configure::read('debug') < 1) {
@@ -24,9 +26,19 @@ public function beforeFilter() {
2426
parent::beforeFilter();
2527
}
2628

29+
/**
30+
* Action for plugin documentation home page
31+
*
32+
* @return void
33+
*/
2734
public function index() {
2835
}
2936

37+
/**
38+
* Action for Bootstrap 2 example page
39+
*
40+
* @return void
41+
*/
3042
public function bootstrap2() {
3143
$this->Session->setFlash(__('Alert notice message testing...'), 'alert', array(
3244
'plugin' => 'BoostCake',
@@ -41,6 +53,11 @@ public function bootstrap2() {
4153
), 'error');
4254
}
4355

56+
/**
57+
* Action for Bootstrap 3 example page
58+
*
59+
* @return void
60+
*/
4461
public function bootstrap3() {
4562
$this->Session->setFlash(__('Alert success message testing...'), 'alert', array(
4663
'plugin' => 'BoostCake',

Test/Case/AllBoostCakeTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?php
22
class AllBoostCakeTest extends CakeTestSuite {
33

4+
/**
5+
* Adds all tests to the AllBoostCakeTest case
6+
*
7+
* @return CakeTestSuite
8+
*/
49
public static function suite() {
510
$suite = new CakeTestSuite('All tests');
611
$path = dirname(__FILE__);

Test/Case/View/Helper/BoostCakeFormHelperTest.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ class Contact extends CakeTestModel {
3232

3333
class BoostCakeFormHelperTest extends CakeTestCase {
3434

35+
/**
36+
* setUp
37+
*
38+
* @return void
39+
*/
3540
public function setUp() {
3641
parent::setUp();
3742
$this->View = new View();
@@ -40,11 +45,21 @@ public function setUp() {
4045
ClassRegistry::addObject('Contact', new Contact());
4146
}
4247

48+
/**
49+
* tearDown
50+
*
51+
* @return void
52+
*/
4353
public function tearDown() {
4454
unset($this->View);
4555
unset($this->Form);
4656
}
4757

58+
/**
59+
* testInput
60+
*
61+
* @return void
62+
*/
4863
public function testInput() {
4964
$result = $this->Form->input('name');
5065
$this->assertTags($result, array(
@@ -108,6 +123,11 @@ public function testInput() {
108123
));
109124
}
110125

126+
/**
127+
* testBeforeInputAfterInput
128+
*
129+
* @return void
130+
*/
111131
public function testBeforeInputAfterInput() {
112132
$result = $this->Form->input('name', array(
113133
'beforeInput' => 'Before Input',
@@ -127,6 +147,11 @@ public function testBeforeInputAfterInput() {
127147
));
128148
}
129149

150+
/**
151+
* testCheckbox
152+
*
153+
* @return void
154+
*/
130155
public function testCheckbox() {
131156
$result = $this->Form->input('name', array('type' => 'checkbox'));
132157
$this->assertTags($result, array(
@@ -179,6 +204,11 @@ public function testCheckbox() {
179204
));
180205
}
181206

207+
/**
208+
* testCheckboxLabelEscape
209+
*
210+
* @return void
211+
*/
182212
public function testCheckboxLabelEscape() {
183213
$result = $this->Form->input('name', array(
184214
'type' => 'checkbox',
@@ -199,6 +229,11 @@ public function testCheckboxLabelEscape() {
199229
));
200230
}
201231

232+
/**
233+
* testSelectMultipleCheckbox
234+
*
235+
* @return void
236+
*/
202237
public function testSelectMultipleCheckbox() {
203238
$result = $this->Form->select('name',
204239
array(
@@ -290,6 +325,11 @@ public function testSelectMultipleCheckbox() {
290325
));
291326
}
292327

328+
/**
329+
* testRadio
330+
*
331+
* @return void
332+
*/
293333
public function testRadio() {
294334
$result = $this->Form->input('name', array(
295335
'type' => 'radio',
@@ -320,6 +360,11 @@ public function testRadio() {
320360
));
321361
}
322362

363+
/**
364+
* testErrorMessage
365+
*
366+
* @return void
367+
*/
323368
public function testErrorMessage() {
324369
$Contact = ClassRegistry::getObject('Contact');
325370
$Contact->validationErrors['password'] = array('Please provide a password');
@@ -402,6 +447,11 @@ public function testErrorMessage() {
402447
));
403448
}
404449

450+
/**
451+
* testPostLink
452+
*
453+
* @return void
454+
*/
405455
public function testPostLink() {
406456
$result = $this->Form->postLink('Delete', '/posts/delete/1', array(
407457
'block' => 'form'

Test/Case/View/Helper/BoostCakeHtmlHelperTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,31 @@
44

55
class BoostCakeHtmlHelperTest extends CakeTestCase {
66

7+
/**
8+
* setUp
9+
*
10+
* @return void
11+
*/
712
public function setUp() {
813
parent::setUp();
914
$View = new View();
1015
$this->Html = new BoostCakeHtmlHelper($View);
1116
}
1217

18+
/**
19+
* tearDown
20+
*
21+
* @return void
22+
*/
1323
public function tearDown() {
1424
unset($this->Html);
1525
}
1626

27+
/**
28+
* testUseTag
29+
*
30+
* @return void
31+
*/
1732
public function testUseTag() {
1833
$result = $this->Html->useTag(
1934
'radio', 'one', 'two', array('three' => 'four'), '<label for="one">label</label>'
@@ -36,6 +51,11 @@ public function testUseTag() {
3651
));
3752
}
3853

54+
/**
55+
* testImage
56+
*
57+
* @return void
58+
*/
3959
public function testImage() {
4060
$result = $this->Html->image('', array('data-src' => 'holder.js/24x24'));
4161
$this->assertTags($result, array(

View/Helper/BoostCakeFormHelper.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class BoostCakeFormHelper extends FormHelper {
1818

1919
/**
2020
* Overwrite FormHelper::input()
21-
* Generates a form input element complete with label and wrapper div
21+
*
22+
* - Generates a form input element complete with label and wrapper div
2223
*
2324
* ### Options
2425
*
@@ -139,10 +140,11 @@ public function input($fieldName, $options = array()) {
139140

140141
/**
141142
* Overwrite FormHelper::_divOptions()
142-
* Generate inner and outer div options
143-
* Generate div options for input
144143
*
145-
* @param array $options
144+
* - Generate inner and outer div options
145+
* - Generate div options for input
146+
*
147+
* @param array $options Options list.
146148
* @return array
147149
*/
148150
protected function _divOptions($options) {
@@ -165,11 +167,12 @@ protected function _divOptions($options) {
165167

166168
/**
167169
* Overwrite FormHelper::_getInput()
168-
* Wrap `<div>` input element
169-
* Generates an input element
170170
*
171-
* @param type $args
172-
* @return type
171+
* - Wrap `<div>` input element
172+
* - Generates an input element
173+
*
174+
* @param array $args The options for the input element
175+
* @return string The generated input element
173176
*/
174177
protected function _getInput($args) {
175178
$input = parent::_getInput($args);
@@ -203,13 +206,14 @@ protected function _getInput($args) {
203206

204207
/**
205208
* Overwrite FormHelper::_selectOptions()
206-
* If $attributes['style'] is `<input type="checkbox">` then replace `<label>` position
207-
* Returns an array of formatted OPTION/OPTGROUP elements
208209
*
209-
* @param array $elements
210-
* @param array $parents
211-
* @param boolean $showParents
212-
* @param array $attributes
210+
* - If $attributes['style'] is `<input type="checkbox">` then replace `<label>` position
211+
* - Returns an array of formatted OPTION/OPTGROUP elements
212+
*
213+
* @param array $elements Elements to format.
214+
* @param array $parents Parents for OPTGROUP.
215+
* @param bool $showParents Whether to show parents.
216+
* @param array $attributes HTML attributes.
213217
* @return array
214218
*/
215219
protected function _selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {

0 commit comments

Comments
 (0)