MDL-61976 mod_wiki: Trim returned value to avoid EOF-related failures
authorDavid Monllao <davidm@moodle.com>
Wed, 9 May 2018 11:39:24 +0000 (13:39 +0200)
committerJun Pataleta <jun@moodle.com>
Thu, 10 May 2018 01:17:29 +0000 (09:17 +0800)
mod/wiki/tests/privacy_test.php

index 7fa9293..cd724b8 100644 (file)
@@ -337,11 +337,11 @@ class mod_wiki_privacy_testcase extends provider_testcase {
 
         // This user was the last one to modify this page, so the page info is returned.
         $data12 = $data[$this->pagepaths[1][2]];
-        $this->assertEquals('update3 <img src="files/Hamster.jpg" alt="Hamster.jpg" />', $data12['page']['cachedcontent']);
+        $this->assertEquals('update3 <img src="files/Hamster.jpg" alt="Hamster.jpg" />', trim($data12['page']['cachedcontent']));
         // He made one revision.
         $this->assertEquals(1, count($data12['revisions']));
         $lastrevision = reset($data12['revisions']);
-        $this->assertEquals('update3 <img src="files/Hamster.jpg">', $lastrevision['content']);
+        $this->assertEquals('update3 <img src="files/Hamster.jpg">', trim($lastrevision['content']));
 
         // Only one file was used in the first wiki by this user - Hamster.jpg.
         $files = writer::with_context($this->contexts[1])->get_files([$this->subwikis[1]]);