Skip to content

Commit

Permalink
Add test for FormHelper::select() + 0
Browse files Browse the repository at this point in the history
Closes #2352
  • Loading branch information
markstory committed Dec 9, 2011
1 parent 586cda8 commit bbd6e22
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit bbd6e22

Please sign in to comment.