e389d4dd536db703938098edbca5cde7cceb79b6
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / Fixtures / tags / autoescape / literal.test
1 --TEST--
2 "autoescape" tag does not apply escaping on literals
3 --TEMPLATE--
4 {% autoescape 'html' %}
5
6 1. Simple literal
7 {{ "<br />" }}
8
9 2. Conditional expression with only literals
10 {{ true ? "<br />" : "<br>" }}
11
12 3. Conditional expression with a variable
13 {{ true ? "<br />" : someVar }}
14
15 4. Nested conditionals with only literals
16 {{ true ? (true ? "<br />" : "<br>") : "\n" }}
17
18 5. Nested conditionals with a variable
19 {{ true ? (true ? "<br />" : someVar) : "\n" }}
20
21 6. Nested conditionals with a variable marked safe
22 {{ true ? (true ? "<br />" : someVar|raw) : "\n" }}
23
24 {% endautoescape %}
25 --DATA--
26 return array()
27 --EXPECT--
28
29 1. Simple literal
30 <br />
31
32 2. Conditional expression with only literals
33 <br />
34
35 3. Conditional expression with a variable
36 &lt;br /&gt;
37
38 4. Nested conditionals with only literals
39 <br />
40
41 5. Nested conditionals with a variable
42 &lt;br /&gt;
43
44 6. Nested conditionals with a variable marked safe
45 <br />