Skip to content

Commit

Permalink
Fix additional errors in hidden().
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 13, 2014
1 parent 4189381 commit f9d2265
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/View/Helper/FormHelper.php
Expand Up @@ -1596,7 +1596,7 @@ public function hidden($fieldName, $options = array()) {
));

if ($secure === true) {
$this->_secure(true, null, '' . $options['value']);
$this->_secure(true, null, '' . $options['val']);
}

$options['type'] = 'hidden';
Expand Down
12 changes: 7 additions & 5 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -7829,12 +7829,14 @@ public function testTextAreaWithStupidCharacters() {
* @return void
*/
public function testHiddenField() {
$this->markTestIncomplete('Need to revisit once models work again.');
$Contact->validationErrors['field'] = 1;
$this->Form->request->data['Contact']['field'] = 'test';
$result = $this->Form->hidden('Contact.field', array('id' => 'theID'));
$this->article['errors'] = [
'field' => true
];
$this->Form->request->data['field'] = 'test';
$this->Form->create($this->article);
$result = $this->Form->hidden('field', array('id' => 'theID'));
$this->assertTags($result, array(
'input' => array('type' => 'hidden', 'class' => 'form-error', 'name' => 'Contact[field]', 'id' => 'theID', 'value' => 'test'))
'input' => array('type' => 'hidden', 'class' => 'form-error', 'name' => 'field', 'id' => 'theID', 'value' => 'test'))
);
}

Expand Down

0 comments on commit f9d2265

Please sign in to comment.