mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
removing file that mistakenly was committed to HEAD
This commit is contained in:
parent
c28245d7e5
commit
7856a8c384
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Unit tests for (some of) ../questionlib.php.
|
||||
*
|
||||
* @copyright © Jamie Pratt
|
||||
* @author Jamie Pratt
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package question
|
||||
*/
|
||||
|
||||
if (!defined('MOODLE_INTERNAL')) {
|
||||
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
||||
}
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/questionlib.php');
|
||||
class questionlib_test extends UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
}
|
||||
|
||||
function test_find_file_links_from_html() {
|
||||
global $CFG;
|
||||
$this->assertEqual(array_keys(find_file_links_from_html("hello <a href='{$CFG->wwwroot}/file.php/2/gg/go.php'>hello</a>", 2)),
|
||||
array("gg/go.php"));
|
||||
$this->assertEqual(array_keys(find_file_links_from_html("hello <a href=\"{$CFG->wwwroot}/file.php/2/gg/go.php\">hello</a>", 2)),
|
||||
array("gg/go.php"));
|
||||
$this->assertEqual(array_keys(find_file_links_from_html('hello <a href=\''.$CFG->wwwroot.'/file.php/1/ggo/fghfgh/sdfsdf/sdf/go.php\'>hello</a>', 1)),
|
||||
array('ggo/fghfgh/sdfsdf/sdf/go.php'));
|
||||
$this->assertEqual(array_keys(find_file_links_from_html('hello <a href=\''.$CFG->wwwroot.'/file.php?file=/1/ggo/fghfgh/sdfsdf/sdf/go.php\'>hello</a>'.
|
||||
"hello <a href='{$CFG->wwwroot}/file.php/2/gg/go.php'>hello</a>" . "hello <a href='{$CFG->wwwroot}/file.php/2/gg/go.php'>hello</a>" .
|
||||
"hello <a href='{$CFG->wwwroot}/file.php/2/gg/go.php'>hello</a>" ."hello <a href='{$CFG->wwwroot}/file.php/2/gg/go.php'>hello</a>",1)),
|
||||
array('ggo/fghfgh/sdfsdf/sdf/go.php'));
|
||||
$this->assertEqual(array_keys(find_file_links_from_html('hello <img src=\''.$CFG->wwwroot.'/file.php/1/ggo/fghfgh/sdfsdf/sdf/go.php\' />', 1)),
|
||||
array('ggo/fghfgh/sdfsdf/sdf/go.php'));
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user