Permalink
Browse files

Add test for FormHelper::select() + 0

Closes #2352
  • Loading branch information...
1 parent 586cda8 commit bbd6e22e267788965d8b64cf657a04b573b95048 @markstory markstory committed Dec 9, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -3529,6 +3529,17 @@ public function testSelect() {
'/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);
}
/**

0 comments on commit bbd6e22

Please sign in to comment.