Skip to content

Commit

Permalink
add test case checkbox label escape
Browse files Browse the repository at this point in the history
  • Loading branch information
slywalker committed Oct 4, 2013
1 parent 0d8139c commit 53a66da
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Test/Case/View/Helper/BoostCakeFormHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ public function testCheckbox() {
));
}

public function testCheckboxLabelEscape() {
$result = $this->Form->input('name', array(
'type' => 'checkbox',
'label' => 'I want $1'
));
$this->assertTags($result, array(
array('div' => array()),
array('div' => array('class' => 'input checkbox')),
array('div' => array('class' => 'checkbox')),
array('input' => array('type' => 'hidden', 'name' => 'data[name]', 'id' => 'name_', 'value' => '0')),
'label' => array('for' => 'name'),
array('input' => array('name' => 'data[name]', 'type' => 'checkbox', 'value' => '1', 'id' => 'name')),
' I want $1',
'/label',
'/div',
'/div',
'/div'
));
}

public function testSelectMultipleCheckbox() {
$result = $this->Form->select('name',
array(
Expand Down

0 comments on commit 53a66da

Please sign in to comment.