Skip to content
Permalink
Browse files

Template for file input already has the type in the string, removing the

option so that it does not appear twice
  • Loading branch information...
lorenzo committed Feb 23, 2014
1 parent 2a35a74 commit 6a72a8bfcf24a053b117f5e5c069383a65748dea
Showing with 10 additions and 9 deletions.
  1. +1 −0 src/View/Helper/FormHelper.php
  2. +9 −9 tests/TestCase/View/Helper/FormHelperTest.php
@@ -1311,6 +1311,7 @@ public function file($fieldName, $options = array()) {
);
}
unset($options['type']);
return $this->widget('file', $options);
}
@@ -2499,27 +2499,27 @@ public function testInputCustomization() {
$result = $this->Form->input('Contact.5.email', array('type' => 'text'));
$expected = array(
'div' => array('class' => 'input text'),
'label' => array('for' => 'Contact5Email'),
'div' => array('class' => 'text'),
'label' => array('for' => 'contact-5-email'),
'Email',
'/label',
array('input' => array(
'type' => 'text', 'name' => 'Contact[5][email]',
'id' => 'Contact5Email'
'id' => 'contact-5-email', 'maxlength' => '255'
)),
'/div'
);
$this->assertTags($result, $expected);
$result = $this->Form->input('Contact.password');
$expected = array(
'div' => array('class' => 'input password'),
'label' => array('for' => 'ContactPassword'),
'div' => array('class' => 'password'),
'label' => array('for' => 'contact-password'),
'Password',
'/label',
array('input' => array(
'type' => 'password', 'name' => 'Contact[password]',
'id' => 'ContactPassword'
'id' => 'contact-password'
)),
'/div'
);
@@ -2529,13 +2529,13 @@ public function testInputCustomization() {
'type' => 'file', 'class' => 'textbox'
));
$expected = array(
'div' => array('class' => 'input file'),
'label' => array('for' => 'ContactEmail'),
'div' => array('class' => 'file'),
'label' => array('for' => 'contact-email'),
'Email',
'/label',
array('input' => array(
'type' => 'file', 'name' => 'Contact[email]', 'class' => 'textbox',
'id' => 'ContactEmail'
'id' => 'contact-email'
)),
'/div'
);

0 comments on commit 6a72a8b

Please sign in to comment.
You can’t perform that action at this time.