Permalink
Browse files

unit tests MDL-20537 Added another unit test for shorten_text

  • Loading branch information...
1 parent 9e12452 commit bb2fcfcbc3278a60603f7aa792c6700732f7f03c Andrew Davis committed Nov 27, 2009
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/simpletest/testmoodlelib.php
@@ -256,6 +256,10 @@ function test_shorten_text() {
$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));
}
}

0 comments on commit bb2fcfc

Please sign in to comment.