3 * Unit tests for (some of) ../weblib.php.
5 * @copyright © 2006 The Open University
6 * @author T.J.Hunt@open.ac.uk
7 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
11 if (!defined('MOODLE_INTERNAL')) {
12 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
15 class web_test
extends UnitTestCase
{
23 function test_format_string() {
25 $this->assertEqual(format_string("& &&&&& &&"), "& &&&&& &&");
26 $this->assertEqual(format_string("ANother & &&&&& Category"), "ANother & &&&&& Category");
27 $this->assertEqual(format_string("ANother & &&&&& Category", true), "ANother & &&&&& Category");
28 $this->assertEqual(format_string("Nick's Test Site & Other things", true), "Nick's Test Site & Other things");
31 $this->assertEqual(format_string("""), """);
34 $this->assertEqual(format_string("&11234;"), "&11234;");
37 $this->assertEqual(format_string("ᅻ"), "ᅻ");
41 $this->assertEqual(s("This Breaks \" Strict"), "This Breaks " Strict");