Skip to content

Commit

Permalink
Update test case for disabled radio buttons (allow boolean value)
Browse files Browse the repository at this point in the history
  • Loading branch information
ingk committed Nov 17, 2011
1 parent 7dfe727 commit d6b9b48
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -3344,6 +3344,28 @@ public function testRadioDisabled() {
'/fieldset'
);
$this->assertTags($result, $expected);

$result = $this->Form->radio(
'Model.field',
array('option A', 'option B'),
array('disabled' => true, 'value' => 'option A')
);
$expected = array(
'fieldset' => array(),
'legend' => array(),
'Field',
'/legend',
array('input' => array('type' => 'radio', 'name' => 'data[Model][field]', 'value' => '0', 'id' => 'ModelField0', 'disabled' => 'disabled', 'checked' => 'checked')),
array('label' => array('for' => 'ModelField0')),
'option A',
'/label',
array('input' => array('type' => 'radio', 'name' => 'data[Model][field]', 'value' => '1', 'id' => 'ModelField1', 'disabled' => 'disabled')),
array('label' => array('for' => 'ModelField1')),
'option B',
'/label',
'/fieldset'
);
$this->assertTags($result, $expected);
}

/**
Expand Down

0 comments on commit d6b9b48

Please sign in to comment.