]> git.mjollnir.org Git - moodle.git/commitdiff
lib MDL-20537 Added another unit test for shorten_text
authorAndrew Davis <andrew@affinitysoftware.net>
Tue, 24 Nov 2009 08:07:41 +0000 (08:07 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Tue, 24 Nov 2009 08:07:41 +0000 (08:07 +0000)
lib/simpletest/testmoodlelib.php

index 7b250d15410a890809969a4d79cf9a76d90f2cf9..b3cab058c581ecc6f09a520425c12970945f6b70 100644 (file)
@@ -380,6 +380,10 @@ class moodlelib_test extends UnitTestCase {
         $text = "<h3>standard 'break-out' sub groups in TGs?</h3>&nbsp;&lt;&lt;There are several";
         $this->assertEqual("<h3>standard 'break-out' sub groups in ...</h3>",
             shorten_text($text, 43));
+
+        $text = "<h1>123456789</h1>";//a string with no convenient breaks
+        $this->assertEqual("<h1>12345...</h1>",
+            shorten_text($text, 8));
     }
 
 }