From 88d4c55ec38c68c07496ed059616b15622fc83e7 Mon Sep 17 00:00:00 2001 From: uckelman Date: Sun, 31 Oct 2010 20:53:21 +0000 Subject: Major refactoring to make bridge easier to test. git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@7431 67b53d14-2c14-4ace-a08f-0dab2b34000c --- test/UtilTest.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/UtilTest.php (limited to 'test/UtilTest.php') diff --git a/test/UtilTest.php b/test/UtilTest.php new file mode 100644 index 0000000..7135b9f --- /dev/null +++ b/test/UtilTest.php @@ -0,0 +1,48 @@ +assertEquals($expected, is_ascii($string)); + } + + public function utf8_quote_provider() { + return array( + array('', '=?UTF-8?B??='), + array('foo', '=?UTF-8?B?Zm9v?='), + array('Heizölrückstoßabdämpfung', '=?UTF-8?B?SGVpesO2bHLDvGNrc3Rvw59hYmTDpG1wZnVuZw==?=') + ); + } + + /** @dataProvider utf8_quote_provider */ + public function test_utf8_quote($string, $expected) { + $this->assertEquals($expected, utf8_quote($string)); + } + + public function utf8_quote_non_ascii_provider() { + return array( + array('', ''), + array('foo', 'foo'), + array('Heizölrückstoßabdämpfung', '=?UTF-8?B?SGVpesO2bHLDvGNrc3Rvw59hYmTDpG1wZnVuZw==?=') + ); + } + + /** @dataProvider utf8_quote_non_ascii_provider */ + public function test_utf8_quote_non_ascii($string, $expected) { + $this->assertEquals($expected, utf8_quote_non_ascii($string)); + } +} + +?> -- cgit v1.2.3