MDL-24060 text_to_html tests. Make sure alt text for LaTeX images doesn't break.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 16 Dec 2010 15:36:24 +0000 (15:36 +0000)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 20 Dec 2010 14:01:43 +0000 (15:01 +0100)
lib/simpletest/testweblib.php

index 7f9b000..4af49a1 100644 (file)
@@ -123,6 +123,10 @@ class web_test extends UnitTestCase {
         $this->assertEqual('[edit]', html_to_text('<img src="edit.png" alt="edit" />'));
     }
 
+    public function test_html_to_text_image_with_backslash() {
+        $this->assertEqual('[\edit]', html_to_text('<img src="edit.png" alt="\edit" />'));
+    }
+
     public function test_html_to_text_nowrap() {
         $long = "Here is a long string, more than 75 characters long, since by default html_to_text wraps text at 75 chars.";
         $this->assertEqual($long, html_to_text($long, 0));