mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Changes to make tests pass...
This commit is contained in:
parent
148870f492
commit
115c6102b9
2 changed files with 9 additions and 7 deletions
|
@ -718,7 +718,9 @@ class FormHelper extends AppHelper {
|
|||
if (isset($options['options'])) {
|
||||
$options['type'] = 'select';
|
||||
} elseif (in_array($fieldKey, array('psword', 'passwd', 'password'))) {
|
||||
$options['type'] = 'password';
|
||||
$options['type'] = 'password';
|
||||
} elseif (isset($options['checked'])) {
|
||||
$options['type'] = 'checkbox';
|
||||
} elseif (isset($this->fieldset[$modelKey]['fields'][$fieldKey])) {
|
||||
$fieldDef = $this->fieldset[$modelKey]['fields'][$fieldKey];
|
||||
$type = $fieldDef['type'];
|
||||
|
@ -772,7 +774,7 @@ class FormHelper extends AppHelper {
|
|||
}
|
||||
|
||||
$autoLength = (!array_key_exists('maxlength', $options) && isset($fieldDef['length']));
|
||||
if ($autoLength && $options['type'] == 'text') {
|
||||
if ($autoLength && $options['type'] == 'text') {
|
||||
$options['maxlength'] = $fieldDef['length'];
|
||||
}
|
||||
if ($autoLength && $fieldDef['type'] == 'float') {
|
||||
|
|
|
@ -5958,18 +5958,18 @@ class FormHelperTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Form->input('User.stuff');
|
||||
$result = $this->Form->input('UserForm.stuff');
|
||||
$expected = array(
|
||||
'div' => array('class' => 'input text'),
|
||||
'label' => array('for' => 'UserStuff'),
|
||||
'label' => array('for' => 'UserFormStuff'),
|
||||
'Stuff',
|
||||
'/label',
|
||||
'input' => array(
|
||||
'type' => 'text', 'name' => 'data[User][stuff]',
|
||||
'id' => 'UserStuff', 'maxlength' => 10
|
||||
'type' => 'text', 'name' => 'data[UserForm][stuff]',
|
||||
'id' => 'UserFormStuff', 'maxlength' => 10
|
||||
),
|
||||
'/div'
|
||||
);
|
||||
);
|
||||
$this->assertTags($result, $expected, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue