Skip to content

Commit 3a0e3c5

Browse files
committed
Add test case for Issue #37
1 parent ab217c0 commit 3a0e3c5

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Test/Case/View/Helper/BoostCakeFormHelperTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,36 @@ public function testSelectMultipleCheckbox() {
262262
));
263263
}
264264

265+
public function testRadio() {
266+
$result = $this->Form->input('name', array(
267+
'type' => 'radio',
268+
'options' => array(
269+
'one' => 'This is one',
270+
'two' => 'This is two'
271+
)
272+
));
273+
$this->assertTags($result, array(
274+
array('div' => array()),
275+
array('div' => array('class' => 'input radio')),
276+
'fieldset' => array(),
277+
'legend' => array(),
278+
'Name',
279+
'/legend',
280+
array('input' => array('type' => 'hidden', 'name' => 'data[name]', 'id' => 'name_', 'value' => '')),
281+
array('label' => array('for' => 'NameOne', 'class' => 'radio')),
282+
array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'one', 'id' => 'NameOne')),
283+
' This is one',
284+
'/label',
285+
array('label' => array('for' => 'NameTwo', 'class' => 'radio')),
286+
array('input' => array('name' => 'data[name]', 'type' => 'radio', 'value' => 'two', 'id' => 'NameTwo')),
287+
' This is two',
288+
'/label',
289+
'/fieldset',
290+
'/div',
291+
'/div'
292+
));
293+
}
294+
265295
public function testErrorMessage() {
266296
$Contact = ClassRegistry::getObject('Contact');
267297
$Contact->validationErrors['password'] = array('Please provide a password');

0 commit comments

Comments
 (0)