From 36ab8f6cb6adaac439378196e73b16aa9c7e61e8 Mon Sep 17 00:00:00 2001 From: Paul Nicholls Date: Thu, 15 Nov 2012 10:50:16 +1300 Subject: [PATCH] MDL-36204: moodle1 backup converter: add unit test to cover this issue --- backup/converter/moodle1/tests/lib_test.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backup/converter/moodle1/tests/lib_test.php b/backup/converter/moodle1/tests/lib_test.php index a97720e21dc..20aca6279c5 100644 --- a/backup/converter/moodle1/tests/lib_test.php +++ b/backup/converter/moodle1/tests/lib_test.php @@ -449,6 +449,19 @@ as it is parsed from the backup file.

download manual
'); } + public function test_referenced_files_urlencoded() { + // This test covers MDL-36204 + $text = 'This is a text containing links to file.php +as it is parsed from the backup file.

Newsno space
+
with urlencoded spaces
'; + + $files = moodle1_converter::find_referenced_files($text); + $this->assertEquals(gettype($files), 'array'); + $this->assertEquals(2, count($files)); + $this->assertTrue(in_array('/pics/news.gif', $files)); + $this->assertTrue(in_array('/pics/news with spaces.gif', $files)); + } + public function test_question_bank_conversion() { global $CFG;