Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for FormHelper::select() + 0

Closes #2352
  • Loading branch information...
commit bbd6e22e267788965d8b64cf657a04b573b95048 1 parent 586cda8
@markstory markstory authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
View
11 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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.