Skip to content

Commit

Permalink
Fixing generation of url inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 24, 2014
1 parent bf0f158 commit 321df80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/View/Helper/FormHelper.php
Expand Up @@ -912,6 +912,9 @@ protected function _getInput($fieldName, $options) {
$opts = $options['options'];
unset($options['options']);
return $this->select($fieldName, $opts, $options);
case 'url':
$options = $this->_initInputField($fieldName, $options);
return $this->widget($options['type'], $options);
default:
return $this->{$options['type']}($fieldName, $options);
}
Expand Down
13 changes: 7 additions & 6 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -7625,14 +7625,15 @@ public function testHtml5Inputs() {
* @return void
*/
public function testHtml5InputWithInput() {
$this->markTestIncomplete('Need to revisit once models work again.');
$result = $this->Form->input('User.website', array(
$this->Form->create();
$this->Form->templates(['groupContainer' => '{{content}}']);
$result = $this->Form->input('website', array(
'type' => 'url',
'value' => 'http://domain.tld',
'div' => false,
'label' => false));
'val' => 'http://domain.tld',
'label' => false
));
$expected = array(
'input' => array('type' => 'url', 'name' => 'User[website]', 'id' => 'UserWebsite', 'value' => 'http://domain.tld')
'input' => array('type' => 'url', 'name' => 'website', 'id' => 'website', 'value' => 'http://domain.tld')
);
$this->assertTags($result, $expected);
}
Expand Down

0 comments on commit 321df80

Please sign in to comment.