From a66fd7b8815b120becb59e92cc02b4c8a3d77679 Mon Sep 17 00:00:00 2001 From: alec Date: Sun, 14 Nov 2010 11:35:38 +0000 Subject: - Fix hanling of HTML entity strings in plai text messages git-svn-id: https://svn.roundcube.net/trunk@4223 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/tests/html_to_text.php | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 roundcubemail/tests/html_to_text.php (limited to 'roundcubemail/tests') diff --git a/roundcubemail/tests/html_to_text.php b/roundcubemail/tests/html_to_text.php new file mode 100644 index 000000000..c1d40d930 --- /dev/null +++ b/roundcubemail/tests/html_to_text.php @@ -0,0 +1,46 @@ +UnitTestCase("HTML-to-Text conversion tests"); + + } + + function test_html2text() + { + $data = array( + 0 => array( + 'title' => 'Test entry', + 'in' => '', + 'out' => '', + ), + 1 => array( + 'title' => 'Basic HTML entities', + 'in' => '"&', + 'out' => '"&', + ), + 2 => array( + 'title' => 'HTML entity string', + 'in' => '"', + 'out' => '"', + ), + ); + + $ht = new html2text(null, false, false); + + foreach ($data as $item) { + $ht->set_html($item['in']); + $res = $ht->get_text(); + $this->assertEqual($item['out'], $res, $item['title']); + } + } + +} -- cgit v1.2.3