MDL-27736 html2text add unit test for Eloy's new code.

This commit is contained in:
Tim Hunt 2011-06-06 16:54:13 +01:00
parent 3709ecb929
commit 0370e3ab0d

View File

@ -136,6 +136,10 @@ class web_test extends UnitTestCase {
$this->assertEqual("\n\nAll the WORLDS a stage.", html_to_text('<p>All the <strong>worlds</strong> a stage.</p>'));
}
public function test_html_to_text_trailing_whitespace() {
$this->assertEqual('With trailing whitespace and some more text', html_to_text("With trailing whitespace \nand some more text", 0));
}
public function test_clean_text() {
$text = "lala <applet>xx</applet>";
$this->assertEqual($text, clean_text($text, FORMAT_PLAIN));
@ -143,7 +147,4 @@ class web_test extends UnitTestCase {
$this->assertEqual('lala xx', clean_text($text, FORMAT_MOODLE));
$this->assertEqual('lala xx', clean_text($text, FORMAT_HTML));
}
}