fixing broken tests in FormHelper, closes #5088

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7379 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
DarkAngelBGE 2008-07-30 13:40:59 +00:00
parent 1fdc76ba1a
commit 1052d21522
2 changed files with 5 additions and 2 deletions

View file

@ -1553,6 +1553,7 @@ class FormHelper extends AppHelper {
$parents[] = $name;
}
$select = array_merge($select, $this->__selectOptions($title, $selected, $parents, $showParents, $attributes));
if (!empty($name)) {
if ($attributes['style'] === 'checkbox') {
$select[] = sprintf($this->Html->tags['fieldsetstart'], $name);
@ -1579,6 +1580,7 @@ class FormHelper extends AppHelper {
if ($showParents || (!in_array($title, $parents))) {
$title = ife($attributes['escape'], h($title), $title);
if ($attributes['style'] === 'checkbox') {
$htmlOptions['value'] = $name;

View file

@ -4218,7 +4218,7 @@ class FormHelperTest extends CakeTestCase {
'berts_son_2' => 'Bertie')
),
null,
array(),
array('showParents' => true),
false
);
@ -4263,9 +4263,10 @@ class FormHelperTest extends CakeTestCase {
)
),
null,
array(),
array('showParents' => true),
false
);
$expected = array(
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
array('option' => array('value' => 1)),