Fix tests

This commit is contained in:
Saophalkun Ponlu 2017-12-08 09:58:52 +13:00
parent 442f2bb762
commit 381ad756f2
3 changed files with 22 additions and 8 deletions

View File

@ -134,16 +134,22 @@ class TextareaField extends FormField
*/ */
public function getAttributes() public function getAttributes()
{ {
return array_merge( $attributes = array_merge(
parent::getAttributes(), parent::getAttributes(),
array( array(
'rows' => $this->getRows(), 'rows' => $this->getRows(),
'cols' => $this->getColumns(), 'cols' => $this->getColumns(),
'value' => null, 'value' => null,
'type' => null, 'type' => null,
'maxlength' => $this->getMaxLength(),
) )
); );
$maxLength = $this->getMaxLength();
if($maxLength) {
$attributes['maxlength'] = $maxLength;
}
return $attributes;
} }

View File

@ -31,7 +31,9 @@
"autoFocus": false, "autoFocus": false,
"customValidationMessage": "", "customValidationMessage": "",
"attributes": [], "attributes": [],
"data": [], "data": {
"maxlength": null
},
"validation": [] "validation": []
}, },
{ {

View File

@ -30,7 +30,6 @@
"disabled": false, "disabled": false,
"autoFocus": false, "autoFocus": false,
"customValidationMessage": "", "customValidationMessage": "",
"maxLength": 40,
"validation": { "validation": {
"required": true, "required": true,
"max": { "max": {
@ -38,7 +37,9 @@
} }
}, },
"attributes": [], "attributes": [],
"data": [] "data": {
"maxlength": 40
}
}, },
{ {
"name": "Date", "name": "Date",
@ -65,7 +66,8 @@
"data": { "data": {
"html5": true, "html5": true,
"min": null, "min": null,
"max": null "max": null,
"maxlength": null
} }
}, },
{ {
@ -89,7 +91,9 @@
"numeric": true "numeric": true
}, },
"attributes": [], "attributes": [],
"data": [] "data": {
"maxlength": null
}
}, },
{ {
"name": "Money", "name": "Money",
@ -112,7 +116,9 @@
"currency": true "currency": true
}, },
"attributes": [], "attributes": [],
"data": [] "data": {
"maxlength": null
}
}, },
{ {
"name": "SecurityID", "name": "SecurityID",