added more unit tests
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 16 Oct 2011 23:16:34 +0000 (01:16 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 16 Oct 2011 23:16:34 +0000 (01:16 +0200)
test/Twig/Tests/Fixtures/filters/convert_encoding.test [new file with mode: 0644]
test/Twig/Tests/Fixtures/filters/escape.test [new file with mode: 0644]
test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test [new file with mode: 0644]

diff --git a/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/test/Twig/Tests/Fixtures/filters/convert_encoding.test
new file mode 100644 (file)
index 0000000..b386d4e
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+"convert_encoding" filter
+--TEMPLATE--
+{{ "愛していますか?"|convert_encoding('ISO-2022-JP', 'UTF-8')|convert_encoding('UTF-8', 'ISO-2022-JP') }}
+--DATA--
+return array()
+--EXPECT--
+愛していますか?
diff --git a/test/Twig/Tests/Fixtures/filters/escape.test b/test/Twig/Tests/Fixtures/filters/escape.test
new file mode 100644 (file)
index 0000000..a606c10
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+"escape" filter
+--TEMPLATE--
+{{ "foo <br />"|e }}
+--DATA--
+return array()
+--EXPECT--
+foo &lt;br /&gt;
diff --git a/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test b/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test
new file mode 100644 (file)
index 0000000..bba26a0
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+"escape" filter
+--TEMPLATE--
+{{ "愛していますか? <br />"|e }}
+--DATA--
+return array()
+--EXPECT--
+愛していますか? &lt;br /&gt;