8000 [Form] Add missing checks for testable features · symfony/symfony@a79b57b · GitHub
[go: up one dir, main page]

Skip to content

Commit a79b57b

Browse files
[Form] Add missing checks for testable features
1 parent 60d3c34 commit a79b57b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,16 @@ public function testSingleChoiceAttributes()
240240
'expanded' => false,
241241
));
242242

243+
$classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : '';
244+
243245
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
244246
'/select
245247
[@name="name"]
246248
[@class="my&class form-control"]
247249
[not(@required)]
248250
[
249251
./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
250-
/following-sibling::option[@value="&b"][@class="foo&bar"][not(@selected)][.="[trans]Choice&B[/trans]"]
252+
/following-sibling::option[@value="&b"]'.$classPart.'[not(@selected)][.="[trans]Choice&B[/trans]"]
251253
]
252254
[count(./option)=2]
253255
'
@@ -529,6 +531,8 @@ public function testMultipleChoiceAttributes()
529531
'expanded' => false,
530532
));
531533

534+
$classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : '';
535+
532536
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class')),
533537
'/select
534538
[@name="name[]"]
@@ -537,7 +541,7 @@ public function testMultipleChoiceAttributes()
537541
[@multiple="multiple"]
538542
[
539543
./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
540-
/following-sibling::option[@value="&b"][@class="foo&bar"][not(@selected)][.="[trans]Choice&B[/trans]"]
544+
/following-sibling::option[@value="&b"]'.$classPart.'[not(@selected)][.="[trans]Choice&B[/trans]"]
541545
]
542546
[count(./option)=2]
543547
'
@@ -634,6 +638,8 @@ public function testSingleChoiceExpandedAttributes()
634638
'expanded' => true,
635639
));
636640

641+
$classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : '';
642+
637643
$this->assertWidgetMatchesXpath($form->createView(), array(),
638644
'/div
639645
[
@@ -652,7 +658,7 @@ public function testSingleChoiceExpandedAttributes()
652658
./label
653659
[.="[trans]Choice&B[/trans]"]
654660
[
655-
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)][@class="foo&bar"]
661+
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]'.$classPart.'
656662
]
657663
]
658664
/following-sibling::input[@type="hidden"][@id="name__token"][@class="form-control"]
@@ -796,6 +802,8 @@ public function testMultipleChoiceExpandedAttributes()
796802
'required' => true,
797803
));
798804

805+
$classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : '';
806+
799807
$this->assertWidgetMatchesXpath($form->createView(), array(),
800808
'/div
801809
[
@@ -814,7 +822,7 @@ public function testMultipleChoiceExpandedAttributes()
814822
./label
815823
[.="[trans]Choice&B[/trans]"]
816824
[
817-
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)][@class="foo&bar"]
825+
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]'.$classPart.'
818826
]
819827
]
820828
/following-sibling::div

0 commit comments

Comments
 (0)
0