@@ -82,6 +82,17 @@ public function testExtraction(iterable|string $resource)
82
82
'translatable-short ' .$ expectedNowdoc => 'prefixtranslatable-short ' .$ expectedNowdoc ,
83
83
'translatable-short concatenated message with heredoc and nowdoc ' => 'prefixtranslatable-short concatenated message with heredoc and nowdoc ' ,
84
84
'translatable-short default domain ' => 'prefixtranslatable-short default domain ' ,
85
+ 'translatable-short-fqn single-quoted key ' => 'prefixtranslatable-short-fqn single-quoted key ' ,
86
+ 'translatable-short-fqn double-quoted key ' => 'prefixtranslatable-short-fqn double-quoted key ' ,
87
+ 'translatable-short-fqn heredoc key ' => 'prefixtranslatable-short-fqn heredoc key ' ,
88
+ 'translatable-short-fqn nowdoc key ' => 'prefixtranslatable-short-fqn nowdoc key ' ,
89
+ "translatable-short-fqn double-quoted key with whitespace and escaped \$\n\" sequences " => "prefixtranslatable-short-fqn double-quoted key with whitespace and escaped \$\n\" sequences " ,
90
+ 'translatable-short-fqn single-quoted key with whitespace and nonescaped \$\n \' sequences ' => 'prefixtranslatable-short-fqn single-quoted key with whitespace and nonescaped \$\n \' sequences ' ,
91
+ 'translatable-short-fqn single-quoted key with "quote mark at the end" ' => 'prefixtranslatable-short-fqn single-quoted key with "quote mark at the end" ' ,
92
+ 'translatable-short-fqn ' .$ expectedHeredoc => 'prefixtranslatable-short-fqn ' .$ expectedHeredoc ,
93
+ 'translatable-short-fqn ' .$ expectedNowdoc => 'prefixtranslatable-short-fqn ' .$ expectedNowdoc ,
94
+ 'translatable-short-fqn concatenated message with heredoc and nowdoc ' => 'prefixtranslatable-short-fqn concatenated message with heredoc and nowdoc ' ,
95
+ 'translatable-short-fqn default domain ' => 'prefixtranslatable-short-fqn default domain ' ,
85
96
'single-quoted key ' => 'prefixsingle-quoted key ' ,
86
97
'double-quoted key ' => 'prefixdouble-quoted key ' ,
87
98
'heredoc key ' => 'prefixheredoc key ' ,
@@ -113,6 +124,11 @@ public function testExtraction(iterable|string $resource)
113
124
'translatable-short other-domain-test-params-short-array ' => 'prefixtranslatable-short other-domain-test-params-short-array ' ,
114
125
'translatable-short other-domain-test-params-long-array ' => 'prefixtranslatable-short other-domain-test-params-long-array ' ,
115
126
'translatable-short typecast ' => 'prefixtranslatable-short typecast ' ,
127
+ 'translatable-short-fqn other-domain-test-no-params-short-array ' => 'prefixtranslatable-short-fqn other-domain-test-no-params-short-array ' ,
128
+ 'translatable-short-fqn other-domain-test-no-params-long-array ' => 'prefixtranslatable-short-fqn other-domain-test-no-params-long-array ' ,
129
+ 'translatable-short-fqn other-domain-test-params-short-array ' => 'prefixtranslatable-short-fqn other-domain-test-params-short-array ' ,
130
+ 'translatable-short-fqn other-domain-test-params-long-array ' => 'prefixtranslatable-short-fqn other-domain-test-params-long-array ' ,
131
+ 'translatable-short-fqn typecast ' => 'prefixtranslatable-short-fqn typecast ' ,
116
132
'other-domain-test-no-params-short-array ' => 'prefixother-domain-test-no-params-short-array ' ,
117
133
'other-domain-test-no-params-long-array ' => 'prefixother-domain-test-no-params-long-array ' ,
118
134
'other-domain-test-params-short-array ' => 'prefixother-domain-test-params-short-array ' ,
@@ -159,6 +175,10 @@ public function testExtraction(iterable|string $resource)
159
175
$ this ->assertEquals (['sources ' => [$ filename .':2 ' ]], $ catalogue ->getMetadata ('translatable-short single-quoted key ' ));
160
176
$ this ->assertEquals (['sources ' => [$ filename .':37 ' ]], $ catalogue ->getMetadata ('translatable-short other-domain-test-no-params-short-array ' , 'not_messages ' ));
161
177
178
+ $ filename = str_replace (\DIRECTORY_SEPARATOR , '/ ' , __DIR__ ).'/../Fixtures/extractor-ast/translatable-short-fqn.html.php ' ;
179
+ $ this ->assertEquals (['sources ' => [$ filename .':2 ' ]], $ catalogue ->getMetadata ('translatable-short-fqn single-quoted key ' ));
180
+ $ this ->assertEquals (['sources ' => [$ filename .':37 ' ]], $ catalogue ->getMetadata ('translatable-short-fqn other-domain-test-no-params-short-array ' , 'not_messages ' ));
181
+
162
182
$ filename = str_replace (\DIRECTORY_SEPARATOR , '/ ' , __DIR__ ).'/../Fixtures/extractor-ast/translation.html.php ' ;
163
183
$ this ->assertEquals (['sources ' => [$ filename .':2 ' ]], $ catalogue ->getMetadata ('single-quoted key ' ));
164
184
$ this ->assertEquals (['sources ' => [$ filename .':37 ' ]], $ catalogue ->getMetadata ('other-domain-test-no-params-short-array ' , 'not_messages ' ));
@@ -199,7 +219,7 @@ public static function resourcesProvider(): array
199
219
if ($ fileInfo ->isDot ()) {
200
220
continue ;
201
221
}
202
- if (\in_array ($ fileInfo ->getBasename (), ['translatable.html.php ' , 'translatable-fqn.html.php ' , 'translatable-short.html.php ' , 'translation.html.php ' , 'validator-constraints.php ' ], true )) {
222
+ if (\in_array ($ fileInfo ->getBasename (), ['translatable.html.php ' , 'translatable-fqn.html.php ' , 'translatable-short.html.php ' , 'translatable-short-fqn.html.php ' , ' translation.html.php ' , 'validator-constraints.php ' ], true )) {
203
223
$ phpFiles [] = $ fileInfo ->getPathname ();
204
224
}
205
225
$ splFiles [] = $ fileInfo ->getFileInfo ();
0 commit comments