Skip to content

Commit

Permalink
Update tests for hidden fields when nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
Walther Lalk committed Nov 6, 2014
1 parent 222fc2b commit 5534a6e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -1476,12 +1476,12 @@ public function testFormSecuredInput() {
$result = $this->Form->input('something', array('type' => 'checkbox'));
$expected = array(
'div' => array('class' => 'input checkbox'),
'label' => array('for' => 'something'),
array('input' => array(
'type' => 'hidden',
'name' => 'something',
'value' => '0'
)),
'label' => array('for' => 'something'),
array('input' => array(
'type' => 'checkbox',
'name' => 'something',
Expand Down Expand Up @@ -2386,8 +2386,8 @@ public function testInputCheckbox() {
));
$expected = array(
'div' => array('class' => 'input checkbox'),
'label' => array('for' => 'user-disabled'),
'input' => array('type' => 'hidden', 'name' => 'User[disabled]', 'value' => '0'),
'label' => array('for' => 'user-disabled'),
array('input' => array(
'type' => 'checkbox',
'name' => 'User[disabled]',
Expand Down Expand Up @@ -2815,12 +2815,12 @@ public function testInputMagicTypeDoesNotOverride() {
$result = $this->Form->input('Model.user', array('type' => 'checkbox'));
$expected = array(
'div' => array('class' => 'input checkbox'),
'label' => array('for' => 'model-user'),
array('input' => array(
'type' => 'hidden',
'name' => 'Model[user]',
'value' => 0,
)),
'label' => array('for' => 'model-user'),
array('input' => array(
'name' => 'Model[user]',
'type' => 'checkbox',
Expand Down Expand Up @@ -6405,7 +6405,7 @@ public function testRequiredAttribute() {
*/
public function testInputsNotNested() {
$this->Form->templates([
'nestingLabel' => '{{input}}<label{{attrs}}>{{text}}</label>',
'nestingLabel' => '{{hidden}}{{input}}<label{{attrs}}>{{text}}</label>',
'formGroup' => '{{input}}{{label}}',
]);
$result = $this->Form->input('foo', ['type' => 'checkbox']);
Expand Down Expand Up @@ -6496,8 +6496,8 @@ public function testInputContainerTemplates() {
]);
$expected = [
'div' => ['class' => 'check'],
'label' => ['for' => 'accept'],
['input' => ['type' => 'hidden', 'name' => 'accept', 'value' => 0]],
'label' => ['for' => 'accept'],
['input' => ['id' => 'accept', 'type' => 'checkbox', 'name' => 'accept', 'value' => 1]],
'Accept',
'/label',
Expand Down

0 comments on commit 5534a6e

Please sign in to comment.