From 060c2d3c9c83fd32a7eabb6acb603e004f237491 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Thu, 29 Jan 2015 13:30:09 +0100 Subject: [PATCH] MDL-48357 webservices: Missing instance property in course contents ws --- course/externallib.php | 1 + course/tests/externallib_test.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/course/externallib.php b/course/externallib.php index 71c24a0d595..c50783c26a3 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -217,6 +217,7 @@ class core_course_external extends external_api { 'id' => new external_value(PARAM_INT, 'activity id'), 'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL), 'name' => new external_value(PARAM_RAW, 'activity module name'), + 'instance' => new external_value(PARAM_INT, 'instance id', VALUE_OPTIONAL), 'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL), 'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL), 'modicon' => new external_value(PARAM_URL, 'activity icon url'), diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index a4e423450ba..a0c29f497e5 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -611,12 +611,14 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $formattedtext = format_text($cm->content, FORMAT_HTML, array('noclean' => true, 'para' => false, 'filter' => false)); $this->assertEquals($formattedtext, $module['description']); + $this->assertEquals($forumcm->instance, $module['instance']); $testexecuted = $testexecuted + 1; } else if ($module['id'] == $labelcm->id and $module['modname'] == 'label') { $cm = $modinfo->cms[$labelcm->id]; $formattedtext = format_text($cm->content, FORMAT_HTML, array('noclean' => true, 'para' => false, 'filter' => false)); $this->assertEquals($formattedtext, $module['description']); + $this->assertEquals($labelcm->instance, $module['instance']); $testexecuted = $testexecuted + 1; } }