Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-2794 html2text - backporting format_text_email tests to 1.8

  • Loading branch information...
commit 5201667eb7abf761604148becd1cb7ac5f5ee3e1 1 parent e3b0266
stronk7 authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 lib/simpletest/testweblib.php
View
17 lib/simpletest/testweblib.php
@@ -38,7 +38,22 @@ function test_format_string() {
// Unicode entities
$this->assertEqual(format_string("ᅻ"), "ᅻ");
- }
+ }
+
+ function test_format_text_email() {
+ $this->assertEqual("\n\nThis is a TEST",
+ format_text_email('<p>This is a <strong>test</strong></p>',FORMAT_HTML));
+ $this->assertEqual("\n\nThis is a TEST",
+ format_text_email('<p class="frogs">This is a <strong class=\'fishes\'>test</strong></p>',FORMAT_HTML));
+ $this->assertEqual("& so is this",
+ format_text_email('&amp; so is this',FORMAT_HTML));
+ $tl = textlib_get_instance();
+ $this->assertEqual('Two bullets: '.$tl->code2utf8(8226).' *',
+ format_text_email('Two bullets: &#x2022; &#8226;',FORMAT_HTML));
+ $this->assertEqual($tl->code2utf8(0x7fd2).$tl->code2utf8(0x7fd2),
+ format_text_email('&#x7fd2;&#x7FD2;',FORMAT_HTML));
+ }
+
function test_s() {
$this->assertEqual(s("This Breaks \" Strict"), "This Breaks &quot; Strict");
Please sign in to comment.
Something went wrong with that request. Please try again.