mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
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:
parent
1fdc76ba1a
commit
1052d21522
2 changed files with 5 additions and 2 deletions
|
@ -1553,6 +1553,7 @@ class FormHelper extends AppHelper {
|
||||||
$parents[] = $name;
|
$parents[] = $name;
|
||||||
}
|
}
|
||||||
$select = array_merge($select, $this->__selectOptions($title, $selected, $parents, $showParents, $attributes));
|
$select = array_merge($select, $this->__selectOptions($title, $selected, $parents, $showParents, $attributes));
|
||||||
|
|
||||||
if (!empty($name)) {
|
if (!empty($name)) {
|
||||||
if ($attributes['style'] === 'checkbox') {
|
if ($attributes['style'] === 'checkbox') {
|
||||||
$select[] = sprintf($this->Html->tags['fieldsetstart'], $name);
|
$select[] = sprintf($this->Html->tags['fieldsetstart'], $name);
|
||||||
|
@ -1579,6 +1580,7 @@ class FormHelper extends AppHelper {
|
||||||
|
|
||||||
if ($showParents || (!in_array($title, $parents))) {
|
if ($showParents || (!in_array($title, $parents))) {
|
||||||
$title = ife($attributes['escape'], h($title), $title);
|
$title = ife($attributes['escape'], h($title), $title);
|
||||||
|
|
||||||
if ($attributes['style'] === 'checkbox') {
|
if ($attributes['style'] === 'checkbox') {
|
||||||
$htmlOptions['value'] = $name;
|
$htmlOptions['value'] = $name;
|
||||||
|
|
||||||
|
|
|
@ -4218,7 +4218,7 @@ class FormHelperTest extends CakeTestCase {
|
||||||
'berts_son_2' => 'Bertie')
|
'berts_son_2' => 'Bertie')
|
||||||
),
|
),
|
||||||
null,
|
null,
|
||||||
array(),
|
array('showParents' => true),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -4263,9 +4263,10 @@ class FormHelperTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
null,
|
null,
|
||||||
array(),
|
array('showParents' => true),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
|
'select' => array('name' => 'data[Model][field]', 'id' => 'ModelField'),
|
||||||
array('option' => array('value' => 1)),
|
array('option' => array('value' => 1)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue