1414use Translation \Extractor \Tests \Functional \Visitor \Php \BasePHPVisitorTest ;
1515use Translation \Extractor \Tests \Resources ;
1616use Translation \Extractor \Visitor \Php \Symfony \FormTypePlaceholder ;
17+ use Translation \Extractor \Visitor \Php \Symfony \ContainerAwareTrans ;
1718
1819/**
1920 * @author Tobias Nyholm <[email protected] > @@ -22,7 +23,8 @@ final class FormTypePlaceholderTest extends BasePHPVisitorTest
2223{
2324 public function testExtract ()
2425 {
25- $ collection = $ this ->getSourceLocations (new FormTypePlaceholder (), Resources \Php \Symfony \PlaceholderFormType::class);
26+ $ collection = $ this ->getSourceLocations (new FormTypePlaceholder (),
27+ Resources \Php \Symfony \PlaceholderFormType::class);
2628
2729 $ this ->assertCount (3 , $ collection );
2830 $ this ->assertEquals ('form.placeholder.text ' , $ collection ->get (0 )->getMessage ());
@@ -32,9 +34,28 @@ public function testExtract()
3234
3335 public function testExtractError ()
3436 {
35- $ collection = $ this ->getSourceLocations (new FormTypePlaceholder (), Resources \Php \Symfony \PlaceholderFormErrorType::class);
37+ $ collection = $ this ->getSourceLocations (new FormTypePlaceholder (),
38+ Resources \Php \Symfony \PlaceholderFormErrorType::class);
3639
3740 $ errors = $ collection ->getErrors ();
3841 $ this ->assertCount (3 , $ errors );
3942 }
43+
44+ public function testChildVisitationNotBlocked ()
45+ {
46+ $ collection = $ this ->getSourceLocations (
47+ [
48+ new FormTypePlaceholder (),
49+ new ContainerAwareTrans (),
50+ ],
51+ Resources \Php \Symfony \ContainerAwareTrans::class
52+ );
53+
54+ $ this ->assertCount (4 , $ collection );
55+
56+ $ this ->assertEquals ('trans0 ' , $ collection ->get (0 )->getMessage ());
57+ $ this ->assertEquals ('trans1 ' , $ collection ->get (1 )->getMessage ());
58+ $ this ->assertEquals ('trans_line ' , $ collection ->get (2 )->getMessage ());
59+ $ this ->assertEquals ('variable ' , $ collection ->get (3 )->getMessage ());
60+ }
4061}
0 commit comments