Add test for FormHelper::select() + 0

Closes #2352
This commit is contained in:
mark_story 2011-12-08 20:15:54 -05:00
parent 586cda8420
commit bbd6e22e26

View file

@ -3529,6 +3529,17 @@ class FormHelperTest extends CakeTestCase {
'/select'
);
$this->assertTags($result, $expected);
$this->Form->request->data['Model']['field'] = 0;
$result = $this->Form->select('Model.field', array('0' => 'No', '1' => 'Yes'));
$expected = array(
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
array('option' => array('value' => '')), '/option',
array('option' => array('value' => '0', 'selected' => 'selected')), 'No', '/option',
array('option' => array('value' => '1')), 'Yes', '/option',
'/select'
);
$this->assertTags($result, $expected);
}
/**