Skip to content

Commit 53a66da

Browse files
committed
add test case checkbox label escape
1 parent 0d8139c commit 53a66da

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Test/Case/View/Helper/BoostCakeFormHelperTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,26 @@ public function testCheckbox() {
179179
));
180180
}
181181

182+
public function testCheckboxLabelEscape() {
183+
$result = $this->Form->input('name', array(
184+
'type' => 'checkbox',
185+
'label' => 'I want $1'
186+
));
187+
$this->assertTags($result, array(
188+
array('div' => array()),
189+
array('div' => array('class' => 'input checkbox')),
190+
array('div' => array('class' => 'checkbox')),
191+
array('input' => array('type' => 'hidden', 'name' => 'data[name]', 'id' => 'name_', 'value' => '0')),
192+
'label' => array('for' => 'name'),
193+
array('input' => array('name' => 'data[name]', 'type' => 'checkbox', 'value' => '1', 'id' => 'name')),
194+
' I want $1',
195+
'/label',
196+
'/div',
197+
'/div',
198+
'/div'
199+
));
200+
}
201+
182202
public function testSelectMultipleCheckbox() {
183203
$result = $this->Form->select('name',
184204
array(

0 commit comments

Comments
 (0)