|
18 | 18 | abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormIntegrationTestCase
|
19 | 19 | {
|
20 | 20 | protected $csrfTokenManager;
|
| 21 | + protected $testableFeatures = array(); |
21 | 22 |
|
22 | 23 | protected function setUp()
|
23 | 24 | {
|
@@ -521,13 +522,15 @@ public function testSingleChoiceAttributes()
|
521 | 522 | 'expanded' => false,
|
522 | 523 | ));
|
523 | 524 |
|
| 525 | + $classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : ''; |
| 526 | + |
524 | 527 | $this->assertWidgetMatchesXpath($form->createView(), array(),
|
525 | 528 | '/select
|
526 | 529 | [@name="name"]
|
527 | 530 | [not(@required)]
|
528 | 531 | [
|
529 | 532 | ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
530 |
| - /following-sibling::option[@value="&b"][@class="foo&bar"][not(@selected)][.="[trans]Choice&B[/trans]"] |
| 533 | + /following-sibling::option[@value="&b"]'.$classPart.'[not(@selected)][.="[trans]Choice&B[/trans]"] |
531 | 534 | ]
|
532 | 535 | [count(./option)=2]
|
533 | 536 | '
|
@@ -804,14 +807,16 @@ public function testMultipleChoiceAttributes()
|
804 | 807 | 'expanded' => false,
|
805 | 808 | ));
|
806 | 809 |
|
| 810 | + $classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : ''; |
| 811 | + |
807 | 812 | $this->assertWidgetMatchesXpath($form->createView(), array(),
|
808 | 813 | '/select
|
809 | 814 | [@name="name[]"]
|
810 | 815 | [@required="required"]
|
811 | 816 | [@multiple="multiple"]
|
812 | 817 | [
|
813 | 818 | ./option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
814 |
| - /following-sibling::option[@value="&b"][@class="foo&bar"][not(@selected)][.="[trans]Choice&B[/trans]"] |
| 819 | + /following-sibling::option[@value="&b"]'.$classPart.'[not(@selected)][.="[trans]Choice&B[/trans]"] |
815 | 820 | ]
|
816 | 821 | [count(./option)=2]
|
817 | 822 | '
|
@@ -893,12 +898,14 @@ public function testSingleChoiceExpandedAttributes()
|
893 | 898 | 'expanded' => true,
|
894 | 899 | ));
|
895 | 900 |
|
| 901 | + $classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : ''; |
| 902 | + |
896 | 903 | $this->assertWidgetMatchesXpath($form->createView(), array(),
|
897 | 904 | '/div
|
898 | 905 | [
|
899 | 906 | ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
|
900 | 907 | /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"]
|
901 |
| - /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][@class="foo&bar"][not(@checked)] |
| 908 | + /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][@value="&b"]'.$classPart.'[not(@checked)] |
902 | 909 | /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"]
|
903 | 910 | /following-sibling::input[@type="hidden"][@id="name__token"]
|
904 | 911 | ]
|
@@ -989,12 +996,14 @@ public function testMultipleChoiceExpandedAttributes()
|
989 | 996 | 'required' => true,
|
990 | 997 | ));
|
991 | 998 |
|
| 999 | + $classPart = in_array('choice_attr', $this->testableFeatures) ? '[@class="foo&bar"]' : ''; |
| 1000 | + |
992 | 1001 | $this->assertWidgetMatchesXpath($form->createView(), array(),
|
993 | 1002 | '/div
|
994 | 1003 | [
|
995 | 1004 | ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
|
996 | 1005 | /following-sibling::label[@for="name_0"][.="[trans]Choice&A[/trans]"]
|
997 |
| - /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_1"][@class="foo&bar"][not(@checked)][not(@required)] |
| 1006 | + /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_1"]'.$classPart.'[not(@checked)][not(@required)] |
998 | 1007 | /following-sibling::label[@for="name_1"][.="[trans]Choice&B[/trans]"]
|
999 | 1008 | /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
|
1000 | 1009 | /following-sibling::label[@for="name_2"][.="[trans]Choice&C[/trans]"]
|
|
0 commit comments