Skip to content
Permalink
Browse files

Fix additional errors in hidden().

  • Loading branch information...
markstory committed Feb 12, 2014
1 parent 4189381 commit f9d2265332fcef6c52403b0ee54510ee7fd43e8c
Showing with 8 additions and 6 deletions.
  1. +1 −1 src/View/Helper/FormHelper.php
  2. +7 −5 tests/TestCase/View/Helper/FormHelperTest.php
@@ -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';
@@ -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'))
);
}

0 comments on commit f9d2265

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