Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing generation of url inputs

  • Loading branch information...
commit 321df805640194f48fefa8bb6f9bd55329d36712 1 parent bf0f158
@lorenzo lorenzo authored
View
3  src/View/Helper/FormHelper.php
@@ -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);
}
View
13 tests/TestCase/View/Helper/FormHelperTest.php
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.