From ba3cd80c0c61e679cef92a1f4f51e645090a1472 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 05 Sep 2012 10:17:56 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail
---
tests/HtmlToText.php | 32 +++++++++++++++-----------------
1 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/tests/html_to_text.php b/tests/HtmlToText.php
similarity index 75%
rename from tests/html_to_text.php
rename to tests/HtmlToText.php
index aabc1a8..b90c61a 100644
--- a/tests/html_to_text.php
+++ b/tests/HtmlToText.php
@@ -5,18 +5,12 @@
*
* @package Tests
*/
-class rcube_test_html2text extends UnitTestCase
+class HtmlToText extends PHPUnit_Framework_TestCase
{
- function __construct()
+ function data_html2text()
{
- $this->UnitTestCase("HTML-to-Text conversion tests");
-
- }
-
- function test_html2text()
- {
- $data = array(
+ return array(
0 => array(
'title' => 'Test entry',
'in' => '',
@@ -48,14 +42,18 @@
'out' => 'Ś',
),
);
-
- $ht = new html2text(null, false, false);
-
- foreach ($data as $idx => $item) {
- $ht->set_html($item['in']);
- $res = $ht->get_text();
- $this->assertEqual($item['out'], $res, $item['title'] . "($idx)");
- }
}
+ /**
+ * @dataProvider data_html2text
+ */
+ function test_html2text($title, $in, $out)
+ {
+ $ht = new html2text(null, false, false);
+
+ $ht->set_html($in);
+ $res = $ht->get_text();
+
+ $this->assertEquals($out, $res, $title);
+ }
}
--
Gitblit v1.9.1