Skip to content

Commit

Permalink
Revert "Merge pull request #538 from mcammaert/2.1". Closes #2723
Browse files Browse the repository at this point in the history
This reverts commit 96f73d6, reversing
changes made to 9d017c2.

Conflicts:

	lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  • Loading branch information
ADmad committed Mar 28, 2012
1 parent 349c175 commit 47558e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -6575,11 +6575,7 @@ public function testCreateCustomRoute() {
*/
public function testCreateWithInputDefaults() {
$this->Form->create('User', array(
'inputDefaults' => array(
'div' => false,
'label' => false,
'error' => array('attributes' => array('wrap' => 'small', 'class' => 'error'))
)
'inputDefaults' => array('div' => false, 'label' => false)
));
$result = $this->Form->input('username');
$expected = array(
Expand All @@ -6595,18 +6591,6 @@ public function testCreateWithInputDefaults() {
'/div'
);
$this->assertTags($result, $expected);

$User = ClassRegistry::getObject('User');
$User->validationErrors['username'] = array('empty');
$result = $this->Form->input('username', array('div' => true, 'label' => 'username', 'error' => array('empty' => __('Required'))));
$expected = array(
'div' => array('class' => 'input text error'),
'label' => array('for' => 'UserUsername'), 'username', '/label',
'input' => array('class' => 'form-error', 'type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername'),
'small' => array('class' => 'error'), 'Required', '/small',
'/div'
);
$this->assertTags($result, $expected);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -936,7 +936,7 @@ public function inputs($fields = null, $blacklist = null) {
public function input($fieldName, $options = array()) {
$this->setEntity($fieldName);

$options = Set::merge(
$options = array_merge(
array('before' => null, 'between' => null, 'after' => null, 'format' => null),
$this->_inputDefaults,
$options
Expand Down

0 comments on commit 47558e8

Please sign in to comment.