7c08ef3653
Not sure if the hotpot module is converting ampersands correctly. $heading and $title are set up differently than in other modules: instead of outputting $course->title, a temporary $title variable is created and assigned that value. That made it difficult for me to decide whether it was already formatted elsewhere or not. Also I didn't format_string() any of the variables included in $navigation rings, because I assume these strings get processed by print_navigation(), which includes format_string().
34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Unit tests for (some of) ../weblib.php.
|
|
*
|
|
* @copyright © 2006 The Open University
|
|
* @author T.J.Hunt@open.ac.uk
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
|
* @package moodlecore
|
|
*/
|
|
|
|
/** */
|
|
require_once(dirname(__FILE__) . '/../../config.php');
|
|
|
|
global $CFG;
|
|
require_once($CFG->libdir . '/simpletestlib.php');
|
|
require_once($CFG->libdir . '/weblib.php');
|
|
|
|
class web_test extends UnitTestCase {
|
|
|
|
function setUp() {
|
|
}
|
|
|
|
function tearDown() {
|
|
}
|
|
|
|
function test_format_string() {
|
|
$this->assertEqual(format_string("& &&&&& &&"), "& &&&&& &&");
|
|
$this->assertEqual(format_string("ANother & &&&&& Category"), "ANother & &&&&& Category");
|
|
$this->assertEqual(format_string("ANother & &&&&& Category", true), "ANother & &&&&& Category");
|
|
$this->assertEqual(format_string("Nick's Test Site & Other things", true), "Nick's Test Site & Other things");
|
|
}
|
|
}
|
|
?>
|