From a41c6e21d2da5cbd16697af12fcfbc7208e321bd Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 17 Oct 2011 01:16:34 +0200 Subject: [PATCH] added more unit tests --- .../Tests/Fixtures/filters/convert_encoding.test | 8 ++++++++ test/Twig/Tests/Fixtures/filters/escape.test | 8 ++++++++ .../filters/escape_non_supported_charset.test | 8 ++++++++ 3 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 test/Twig/Tests/Fixtures/filters/convert_encoding.test create mode 100644 test/Twig/Tests/Fixtures/filters/escape.test create mode 100644 test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test diff --git a/test/Twig/Tests/Fixtures/filters/convert_encoding.test b/test/Twig/Tests/Fixtures/filters/convert_encoding.test new file mode 100644 index 0000000..b386d4e --- /dev/null +++ b/test/Twig/Tests/Fixtures/filters/convert_encoding.test @@ -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 index 0000000..a606c10 --- /dev/null +++ b/test/Twig/Tests/Fixtures/filters/escape.test @@ -0,0 +1,8 @@ +--TEST-- +"escape" filter +--TEMPLATE-- +{{ "foo
"|e }} +--DATA-- +return array() +--EXPECT-- +foo <br /> 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 index 0000000..bba26a0 --- /dev/null +++ b/test/Twig/Tests/Fixtures/filters/escape_non_supported_charset.test @@ -0,0 +1,8 @@ +--TEST-- +"escape" filter +--TEMPLATE-- +{{ "愛していますか?
"|e }} +--DATA-- +return array() +--EXPECT-- +愛していますか? <br /> -- 1.7.2.5