Definition at line 12 of file TransTest.php.
◆ getTests()
Twig_Tests_Node_TransTest::getTests |
( |
| ) |
|
Reimplemented from Twig_Test_NodeTestCase.
Definition at line 37 of file TransTest.php.
38 {
40
44
47 $tests[] = array($node,
'echo gettext("Hello");');
48
51 ), array(), 0);
53 $tests[] = array($node,
'echo gettext("Hello");');
54
59 ), array(), 0);
61 $tests[] = array($node, sprintf(
'echo strtr(gettext("J\'ai %%foo%% pommes"), array("%%foo%%" => %s, ));', $this->
getVariableGetter(
'foo')));
62
68 ), array(), 0);
75 ), array(), 0);
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')));
78
79
84 ), array(), 0);
85
87 $tests[] = array($node, sprintf(
'echo strtr(gettext("J\'ai %%foo%% pommes"), array("%%foo%%" => %s, ));', $this->
getVariableGetter(
'foo')));
88
89
93 $tests[] = array($node,
"// notes: Notes for translators\necho gettext(\"Hello\");");
94
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\");");
99
106 ), array(), 0);
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), ));');
110
112 }
Represents a node that outputs an expression.
Represents a node in the AST.
getVariableGetter($name, $line=false)
References $tests, and Twig_Test_NodeTestCase\getVariableGetter().
◆ testConstructor()
Twig_Tests_Node_TransTest::testConstructor |
( |
| ) |
|
@covers \Twig_Node_Trans::__construct
Definition at line 17 of file TransTest.php.
18 {
22 ), array(), 0);
29 ), array(), 0);
31
32 $this->assertEquals($body, $node->getNode('body'));
33 $this->assertEquals($count, $node->getNode('count'));
34 $this->assertEquals($plural, $node->getNode('plural'));
35 }
The documentation for this class was generated from the following file:
- libs/composer/vendor/twig/extensions/test/Twig/Tests/Node/TransTest.php