From 6084d782f2e6e57248463bf10b99eeee543e0049 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sun, 14 Nov 2010 11:35:38 +0000 Subject: - Fix hanling of HTML entity strings in plai text messages --- tests/html_to_text.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/html_to_text.php (limited to 'tests/html_to_text.php') diff --git a/tests/html_to_text.php b/tests/html_to_text.php new file mode 100644 index 000000000..c1d40d930 --- /dev/null +++ b/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