32 $this->assertEquals($body, $node->getNode(
'body'));
33 $this->assertEquals($count, $node->getNode(
'count'));
34 $this->assertEquals($plural, $node->getNode(
'plural'));
47 $tests[] =
array($node,
'echo gettext("Hello");');
53 $tests[] =
array($node,
'echo gettext("Hello");');
61 $tests[] =
array($node, sprintf(
'echo strtr(gettext("J\'ai %%foo%% pommes"), array("%%foo%%" => %s, ));', $this->
getVariableGetter(
'foo')));
77 $tests[] =
array($node, sprintf(
'echo strtr(ngettext("Hey %%name%%, I have one apple", "Hey %%name%%, I have %%count%% apples", abs(12)), array("%%name%%" => %s, "%%name%%" => %s, "%%count%%" => abs(12), ));', $this->
getVariableGetter(
'name'), $this->
getVariableGetter(
'name')));
87 $tests[] =
array($node, sprintf(
'echo strtr(gettext("J\'ai %%foo%% pommes"), array("%%foo%%" => %s, ));', $this->
getVariableGetter(
'foo')));
93 $tests[] =
array($node,
"// notes: Notes for translators\necho gettext(\"Hello\");");
96 $notes =
new Twig_Node_Text(
"Notes for translators\nand line breaks", 0);
98 $tests[] =
array($node,
"// notes: Notes for translators and line breaks\necho gettext(\"Hello\");");
109 $tests[] =
array($node,
"// notes: Notes for translators\n".
'echo strtr(ngettext("There is 1 pending task", "There are %count% pending tasks", abs(5)), array("%count%" => abs(5), ));');
Represents a node in the AST.
testConstructor()
::__construct
Represents a node that outputs an expression.
Create styles array
The data for the language used.
getVariableGetter($name, $line=false)