Skip to content

Commit

Permalink
re-adding the input class to the groupContainer template
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 23, 2014
1 parent 1cea960 commit 5796ee9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/View/Helper/FormHelper.php
Expand Up @@ -165,8 +165,8 @@ class FormHelper extends Helper {
'radioContainer' => '{{input}}{{label}}',
'textarea' => '<textarea name="{{name}}"{{attrs}}>{{value}}</textarea>',
'formGroup' => '{{label}}{{input}}',
'groupContainer' => '<div class="{{type}}{{required}}">{{content}}</div>',
'groupContainerError' => '<div class="{{type}}{{required}} error">{{content}}{{error}}</div>'
'groupContainer' => '<div class="input {{type}}{{required}}">{{content}}</div>',
'groupContainerError' => '<div class="input {{type}}{{required}} error">{{content}}{{error}}</div>'
];

/**
Expand Down
20 changes: 10 additions & 10 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -2455,7 +2455,7 @@ public function testInputCustomization() {
$this->Form->create([], ['context' => ['table' => 'Contacts']]);
$result = $this->Form->input('Contact.email', array('id' => 'custom'));
$expected = array(
'div' => array('class' => 'email'),
'div' => array('class' => 'input email'),
'label' => array('for' => 'custom'),
'Email',
'/label',
Expand Down Expand Up @@ -2485,7 +2485,7 @@ public function testInputCustomization() {

$result = $this->Form->input('Contact.email', array('type' => 'text'));
$expected = array(
'div' => array('class' => 'text'),
'div' => array('class' => 'input text'),
'label' => array('for' => 'contact-email'),
'Email',
'/label',
Expand All @@ -2499,7 +2499,7 @@ public function testInputCustomization() {

$result = $this->Form->input('Contact.5.email', array('type' => 'text'));
$expected = array(
'div' => array('class' => 'text'),
'div' => array('class' => 'input text'),
'label' => array('for' => 'contact-5-email'),
'Email',
'/label',
Expand All @@ -2513,7 +2513,7 @@ public function testInputCustomization() {

$result = $this->Form->input('Contact.password');
$expected = array(
'div' => array('class' => 'password'),
'div' => array('class' => 'input password'),
'label' => array('for' => 'contact-password'),
'Password',
'/label',
Expand All @@ -2529,7 +2529,7 @@ public function testInputCustomization() {
'type' => 'file', 'class' => 'textbox'
));
$expected = array(
'div' => array('class' => 'file'),
'div' => array('class' => 'input file'),
'label' => array('for' => 'contact-email'),
'Email',
'/label',
Expand All @@ -2545,7 +2545,7 @@ public function testInputCustomization() {
$this->Form->create($entity, ['context' => ['table' => 'Contacts']]);
$result = $this->Form->input('Contact.phone');
$expected = array(
'div' => array('class' => 'tel'),
'div' => array('class' => 'input tel'),
'label' => array('for' => 'contact-phone'),
'Phone',
'/label',
Expand All @@ -2562,7 +2562,7 @@ public function testInputCustomization() {
$this->Form->create();
$result = $this->Form->input('Model.0.OtherModel.field', array('id' => 'myId'));
$expected = array(
'div' => array('class' => 'text'),
'div' => array('class' => 'input text'),
'label' => array('for' => 'myId'),
'Field',
'/label',
Expand All @@ -2580,7 +2580,7 @@ public function testInputCustomization() {
$this->Form->create($entity, ['context' => ['table' => 'Contacts']]);
$result = $this->Form->input('Contact.field');
$expected = array(
'div' => array('class' => 'text error'),
'div' => array('class' => 'input text error'),
'label' => array('for' => 'contact-field'),
'Field',
'/label',
Expand Down Expand Up @@ -2623,7 +2623,7 @@ public function testInputCustomization() {
)
));
$expected = array(
'div' => array('class' => 'text error'),
'div' => array('class' => 'input text error'),
'label' => array('for' => 'contact-field'),
'Field',
'/label',
Expand All @@ -2643,7 +2643,7 @@ public function testInputCustomization() {
)
));
$expected = array(
'div' => array('class' => 'text error'),
'div' => array('class' => 'input text error'),
'label' => array('for' => 'contact-field'),
'Field',
'/label',
Expand Down

0 comments on commit 5796ee9

Please sign in to comment.