aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test')
-rw-r--r--vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test69
1 files changed, 69 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test
new file mode 100644
index 00000000..4f415201
--- /dev/null
+++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/autoescape/type.test
@@ -0,0 +1,69 @@
1--TEST--
2escape types
3--TEMPLATE--
4
51. autoescape 'html' |escape('js')
6
7{% autoescape 'html' %}
8<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
9{% endautoescape %}
10
112. autoescape 'html' |escape('js')
12
13{% autoescape 'html' %}
14<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
15{% endautoescape %}
16
173. autoescape 'js' |escape('js')
18
19{% autoescape 'js' %}
20<a onclick="alert(&quot;{{ msg|escape('js') }}&quot;)"></a>
21{% endautoescape %}
22
234. no escape
24
25{% autoescape false %}
26<a onclick="alert(&quot;{{ msg }}&quot;)"></a>
27{% endautoescape %}
28
295. |escape('js')|escape('html')
30
31{% autoescape false %}
32<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
33{% endautoescape %}
34
356. autoescape 'html' |escape('js')|escape('html')
36
37{% autoescape 'html' %}
38<a onclick="alert(&quot;{{ msg|escape('js')|escape('html') }}&quot;)"></a>
39{% endautoescape %}
40
41--DATA--
42return array('msg' => "<>\n'\"")
43--EXPECT--
44
451. autoescape 'html' |escape('js')
46
47<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
48
492. autoescape 'html' |escape('js')
50
51<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
52
533. autoescape 'js' |escape('js')
54
55<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
56
574. no escape
58
59<a onclick="alert(&quot;<>
60'"&quot;)"></a>
61
625. |escape('js')|escape('html')
63
64<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
65
666. autoescape 'html' |escape('js')|escape('html')
67
68<a onclick="alert(&quot;\x3C\x3E\x0A\x27\x22&quot;)"></a>
69