MDL-71252 completion: PHPUnit failure

This commit is contained in:
Huong Nguyen 2021-04-27 08:42:37 +07:00
parent bda8e0fb2a
commit 5e7ff4b80c

View File

@ -1437,8 +1437,9 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$result = core_course_external::get_course_contents($course->id); $result = core_course_external::get_course_contents($course->id);
$result = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $result); $result = external_api::clean_returnvalue(core_course_external::get_course_contents_returns(), $result);
$this->assertCount(1, $result[0]['modules']); // One module, first section. $this->assertCount(1, $result[0]['modules']); // One module, first section.
$customdata = unserialize(json_decode($result[0]['modules'][0]['customdata'])); $customdata = json_decode($result[0]['modules'][0]['customdata']);
$this->assertEquals('text/plain', $customdata['filedetails']['mimetype']); $displayoptions = unserialize($customdata->displayoptions);
$this->assertEquals('text/plain', $displayoptions['filedetails']['mimetype']);
} }
/** /**