Skip to content
Permalink
Browse files

Changed test attribute to `data-name` more meaningful

Removed rogue `label` element set
  • Loading branch information...
lilHermit committed Feb 2, 2017
1 parent 9495517 commit 9779b579d75649919594ec43d0b049d6c4280803
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/View/Helper/FormHelper.php
  2. +6 −6 tests/TestCase/View/Helper/FormHelperTest.php
@@ -1856,7 +1856,7 @@ public function submit($caption = null, array $options = [])
$input = $this->formatTemplate('inputSubmit', [
'type' => $type,
'attrs' => $this->templater()->formatAttributes($options, ['label']),
'attrs' => $this->templater()->formatAttributes($options),
'templateVars' => $options['templateVars']
]);
@@ -8601,17 +8601,17 @@ public function testControlLabelManipulation()
$result = $this->Form->radio('test', ['A', 'B'], [
'label' => [
'class' => ['custom-class', 'another-class'],
'some-other-attr' => 'blah'
'data-name' => 'bob'
],
'value' => 1
]);
$expected = [
'input' => ['type' => 'hidden', 'name' => 'test', 'value' => ''],
['label' => ['class' => 'custom-class another-class', 'some-other-attr' => 'blah', 'for' => 'test-0']],
['label' => ['class' => 'custom-class another-class', 'data-name' => 'bob', 'for' => 'test-0']],
['input' => ['type' => 'radio', 'name' => 'test', 'value' => '0', 'id' => 'test-0']],
'A',
'/label',
['label' => ['class' => 'custom-class another-class selected', 'some-other-attr' => 'blah', 'for' => 'test-1']],
['label' => ['class' => 'custom-class another-class selected', 'data-name' => 'bob', 'for' => 'test-1']],
['input' => [
'type' => 'radio',
'name' => 'test',
@@ -8712,7 +8712,7 @@ public function testControlLabelManipulation()
['text' => 'First Checkbox', 'value' => 1],
['text' => 'Second Checkbox', 'value' => 2]
],
'optionsLabel' => ['class' => ['custom-class', 'another-class'], 'some-other-attr' => 'blah'],
'optionsLabel' => ['class' => ['custom-class', 'another-class'], 'data-name' => 'bob'],
'value' => ['1']
]);
@@ -8726,7 +8726,7 @@ public function testControlLabelManipulation()
['div' => ['class' => 'checkbox']],
['label' => [
'class' => 'custom-class another-class selected',
'some-other-attr' => 'blah',
'data-name' => 'bob',
'for' => 'checkbox1-1'
]],
['input' => [
@@ -8742,7 +8742,7 @@ public function testControlLabelManipulation()
['div' => ['class' => 'checkbox']],
['label' => [
'class' => 'custom-class another-class',
'some-other-attr' => 'blah',
'data-name' => 'bob',
'for' => 'checkbox1-2'
]],
['input' => [

0 comments on commit 9779b57

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