-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: string-interpolation_feature.test_with_alias
- Loading branch information
1 parent
a7f885c
commit f375187
Showing
1 changed file
with
139 additions
and
139 deletions.
There are no files selected for viewing
278 changes: 139 additions & 139 deletions
278
...ges/php/string-interpolation_feature.test → ...ing-interpolation_feature.test_with_alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,140 +1,140 @@ | ||
"This $variable is interpolated" | ||
"$foo[2], $bar[-4], $foo[$bar]" | ||
"$foo->bar" | ||
"More {$interpolation}" | ||
"{$arr['key']}, {$arr['foo'][3]}" | ||
"{${$name}}, but not {\${\$name}}" | ||
"the return value of getName(): {${getName()}}" | ||
"the return value of \$object->getName(): {${$object->getName()}}" | ||
"{$foo->$bar}, {$foo->{$baz[1]}}" | ||
<<<FOO | ||
Heredoc strings $also->support {${$string->interpolation()}} | ||
FOO; | ||
<<<"FOO_BAR" | ||
{${$name}}, but not {\${\$name}} | ||
FOO_BAR; | ||
---------------------------------------------------- | ||
[ | ||
["double-quoted-string", [ | ||
"\"This ", | ||
["interpolation", [["variable", "$variable"]]], | ||
" is interpolated\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"", | ||
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["number", "2"], ["punctuation", "]"]]], | ||
", ", | ||
["interpolation", [["variable", "$bar"], ["punctuation", "["], ["operator", "-"], ["number", "4"], ["punctuation", "]"]]], | ||
", ", | ||
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["variable", "$bar"], ["punctuation", "]"]]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"", | ||
["interpolation", [["variable", "$foo"], ["operator", "->"], ["property", "bar"]]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"More ", | ||
["interpolation", [["punctuation", "{"], ["variable", "$interpolation"], ["punctuation", "}"]]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$arr"], ["punctuation", "["], ["single-quoted-string", "'key'"], ["punctuation", "]"], | ||
["punctuation", "}"] | ||
]], | ||
", ", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$arr"], | ||
["punctuation", "["], ["single-quoted-string", "'foo'"], ["punctuation", "]"], | ||
["punctuation", "["], ["number", "3"], ["punctuation", "]"], | ||
["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$name"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
", but not {\\${\\$name}}\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"the return value of getName(): ", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["function", "getName"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"the return value of \\$object->getName(): ", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$object"], ["operator", "->"], ["function", "getName"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$foo"], ["operator", "->"], ["variable", "$bar"], | ||
["punctuation", "}"] | ||
]], | ||
", ", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$foo"], ["operator", "->"], ["punctuation", "{"], | ||
["variable", "$baz"], ["punctuation", "["], ["number", "1"], ["punctuation", "]"], | ||
["punctuation", "}"], | ||
["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["heredoc-string", [ | ||
["delimiter", [ | ||
["punctuation", "<<<"], "FOO" | ||
]], | ||
"\r\nHeredoc strings ", | ||
["interpolation", [ | ||
["variable", "$also"], ["operator", "->"], ["property", "support"] | ||
]], | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$string"], ["operator", "->"], ["function", "interpolation"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
["delimiter", [ | ||
"FOO", ["punctuation", ";"] | ||
]] | ||
]], | ||
["heredoc-string", [ | ||
["delimiter", [ | ||
["punctuation", "<<<\""], "FOO_BAR", ["punctuation", "\""] | ||
]], | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$name"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
", but not {\\${\\$name}}\r\n", | ||
["delimiter", [ | ||
"FOO_BAR", ["punctuation", ";"] | ||
]] | ||
]] | ||
] | ||
---------------------------------------------------- | ||
"This $variable is interpolated" | ||
"$foo[2], $bar[-4], $foo[$bar]" | ||
"$foo->bar" | ||
"More {$interpolation}" | ||
"{$arr['key']}, {$arr['foo'][3]}" | ||
"{${$name}}, but not {\${\$name}}" | ||
"the return value of getName(): {${getName()}}" | ||
"the return value of \$object->getName(): {${$object->getName()}}" | ||
"{$foo->$bar}, {$foo->{$baz[1]}}" | ||
<<<FOO | ||
Heredoc strings $also->support {${$string->interpolation()}} | ||
FOO; | ||
<<<"FOO_BAR" | ||
{${$name}}, but not {\${\$name}} | ||
FOO_BAR; | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string double-quoted-string", [ | ||
"\"This ", | ||
["interpolation", [["variable", "$variable"]]], | ||
" is interpolated\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"", | ||
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["number", "2"], ["punctuation", "]"]]], | ||
", ", | ||
["interpolation", [["variable", "$bar"], ["punctuation", "["], ["operator", "-"], ["number", "4"], ["punctuation", "]"]]], | ||
", ", | ||
["interpolation", [["variable", "$foo"], ["punctuation", "["], ["variable", "$bar"], ["punctuation", "]"]]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"", | ||
["interpolation", [["variable", "$foo"], ["operator", "->"], ["property", "bar"]]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"More ", | ||
["interpolation", [["punctuation", "{"], ["variable", "$interpolation"], ["punctuation", "}"]]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$arr"], ["punctuation", "["], ["string single-quoted-string", "'key'"], ["punctuation", "]"], | ||
["punctuation", "}"] | ||
]], | ||
", ", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$arr"], | ||
["punctuation", "["], ["string single-quoted-string", "'foo'"], ["punctuation", "]"], | ||
["punctuation", "["], ["number", "3"], ["punctuation", "]"], | ||
["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$name"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
", but not {\\${\\$name}}\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"the return value of getName(): ", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["function", "getName"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"the return value of \\$object->getName(): ", | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$object"], ["operator", "->"], ["function", "getName"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["string double-quoted-string", [ | ||
"\"", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$foo"], ["operator", "->"], ["variable", "$bar"], | ||
["punctuation", "}"] | ||
]], | ||
", ", | ||
["interpolation", [ | ||
["punctuation", "{"], | ||
["variable", "$foo"], ["operator", "->"], ["punctuation", "{"], | ||
["variable", "$baz"], ["punctuation", "["], ["number", "1"], ["punctuation", "]"], | ||
["punctuation", "}"], | ||
["punctuation", "}"] | ||
]], | ||
"\"" | ||
]], | ||
["string heredoc-string", [ | ||
["delimiter symbol", [ | ||
["punctuation", "<<<"], "FOO" | ||
]], | ||
"\r\nHeredoc strings ", | ||
["interpolation", [ | ||
["variable", "$also"], ["operator", "->"], ["property", "support"] | ||
]], | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$string"], ["operator", "->"], ["function", "interpolation"], ["punctuation", "("], ["punctuation", ")"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
["delimiter symbol", [ | ||
"FOO", ["punctuation", ";"] | ||
]] | ||
]], | ||
["string heredoc-string", [ | ||
["delimiter symbol", [ | ||
["punctuation", "<<<\""], "FOO_BAR", ["punctuation", "\""] | ||
]], | ||
["interpolation", [ | ||
["punctuation", "{"], ["variable", "$"], ["punctuation", "{"], | ||
["variable", "$name"], | ||
["punctuation", "}"], ["punctuation", "}"] | ||
]], | ||
", but not {\\${\\$name}}\r\n", | ||
["delimiter symbol", [ | ||
"FOO_BAR", ["punctuation", ";"] | ||
]] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for interpolation inside strings. |