@@ -168,6 +168,20 @@ public function testLabel()
168168 );
169169 }
170170
171+ public function testLabelWithoutTranslation ()
172+ {
173+ $ form = $ this ->factory ->createNamed ('name ' , 'text ' , null , array (
174+ 'translation_domain ' => false ,
175+ ));
176+
177+ $ this ->assertMatchesXpath ($ this ->renderLabel ($ form ->createView ()),
178+ '/label
179+ [@for="name"]
180+ [.="Name"]
181+ '
182+ );
183+ }
184+
171185 public function testLabelOnForm ()
172186 {
173187 $ form = $ this ->factory ->createNamed ('name ' , 'date ' );
@@ -513,6 +527,28 @@ public function testSingleChoice()
513527 );
514528 }
515529
530+ public function testSingleChoiceWithoutTranslation ()
531+ {
532+ $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , '&a ' , array (
533+ 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
534+ 'multiple ' => false ,
535+ 'expanded ' => false ,
536+ 'choice_translation_domain ' => false ,
537+ ));
538+
539+ $ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
540+ '/select
541+ [@name="name"]
542+ [not(@required)]
543+ [
544+ ./option[@value="&a"][@selected="selected"][.="Choice&A"]
545+ /following-sibling::option[@value="&b"][not(@selected)][.="Choice&B"]
546+ ]
547+ [count(./option)=2]
548+ '
549+ );
550+ }
551+
516552 public function testSingleChoiceAttributes ()
517553 {
518554 $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , '&a ' , array (
@@ -889,6 +925,29 @@ public function testSingleChoiceExpanded()
889925 );
890926 }
891927
928+ public function testSingleChoiceExpandedWithoutTranslation ()
929+ {
930+ $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , '&a ' , array (
931+ 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' ),
932+ 'multiple ' => false ,
933+ 'expanded ' => true ,
934+ 'choice_translation_domain ' => false ,
935+ ));
936+
937+ $ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
938+ '/div
939+ [
940+ ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
941+ /following-sibling::label[@for="name_0"][.="Choice&A"]
942+ /following-sibling::input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
943+ /following-sibling::label[@for="name_1"][.="Choice&B"]
944+ /following-sibling::input[@type="hidden"][@id="name__token"]
945+ ]
946+ [count(./input)=3]
947+ '
948+ );
949+ }
950+
892951 public function testSingleChoiceExpandedAttributes ()
893952 {
894953 $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , '&a ' , array (
@@ -986,6 +1045,32 @@ public function testMultipleChoiceExpanded()
9861045 );
9871046 }
9881047
1048+ public function testMultipleChoiceExpandedWithoutTranslation ()
1049+ {
1050+ $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , array ('&a ' , '&c ' ), array (
1051+ 'choices ' => array ('&a ' => 'Choice&A ' , '&b ' => 'Choice&B ' , '&c ' => 'Choice&C ' ),
1052+ 'multiple ' => true ,
1053+ 'expanded ' => true ,
1054+ 'required ' => true ,
1055+ 'choice_translation_domain ' => false ,
1056+ ));
1057+
1058+ $ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
1059+ '/div
1060+ [
1061+ ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
1062+ /following-sibling::label[@for="name_0"][.="Choice&A"]
1063+ /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
1064+ /following-sibling::label[@for="name_1"][.="Choice&B"]
1065+ /following-sibling::input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
1066+ /following-sibling::label[@for="name_2"][.="Choice&C"]
1067+ /following-sibling::input[@type="hidden"][@id="name__token"]
1068+ ]
1069+ [count(./input)=4]
1070+ '
1071+ );
1072+ }
1073+
9891074 public function testMultipleChoiceExpandedAttributes ()
9901075 {
9911076 $ form = $ this ->factory ->createNamed ('name ' , 'choice ' , array ('&a ' , '&c ' ), array (
0 commit comments