aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/literal.test
blob: e389d4dd536db703938098edbca5cde7cceb79b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--TEST--
"autoescape" tag does not apply escaping on literals
--TEMPLATE--
{% autoescape 'html' %}

1. Simple literal
{{ "<br />" }}

2. Conditional expression with only literals
{{ true ? "<br />" : "<br>" }}

3. Conditional expression with a variable
{{ true ? "<br />" : someVar }}

4. Nested conditionals with only literals
{{ true ? (true ? "<br />" : "<br>") : "\n" }}

5. Nested conditionals with a variable
{{ true ? (true ? "<br />" : someVar) : "\n" }}

6. Nested conditionals with a variable marked safe
{{ true ? (true ? "<br />" : someVar|raw) : "\n" }}

{% endautoescape %}
--DATA--
return array()
--EXPECT--

1. Simple literal
<br />

2. Conditional expression with only literals
<br />

3. Conditional expression with a variable
&lt;br /&gt;

4. Nested conditionals with only literals
<br />

5. Nested conditionals with a variable
&lt;br /&gt;

6. Nested conditionals with a variable marked safe
<br />