MDL-65078 competencies: webservices

The webservice list_course_module_competencies calls a function that does not exist and
is not exposed as a webservice.
This commit is contained in:
Damyon Wiese
2019-07-24 09:14:28 +08:00
committed by Peter
parent f7e108438f
commit bde97497ef
6 changed files with 148 additions and 4 deletions
+10
View File
@@ -2757,6 +2757,16 @@ class core_competency_api_testcase extends advanced_testcase {
$result = api::list_course_module_competencies_in_course_module($cm->id);
$this->assertEquals($result[0]->get('competencyid'), $c->get('id'));
$this->assertEquals($result[1]->get('competencyid'), $c2->get('id'));
// Now get the course competency and coursemodule competency together.
$result = api::list_course_module_competencies($cm->id);
// Now we should have an array and each element of the array should have a competency and
// a coursemodulecompetency.
foreach ($result as $instance) {
$cmc = $instance['coursemodulecompetency'];
$c = $instance['competency'];
$this->assertEquals($cmc->get('competencyid'), $c->get('id'));
}
}
/**