Merge branch 'MDL-69700-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE

This commit is contained in:
Jun Pataleta
2022-01-06 12:00:40 +08:00
2 changed files with 6 additions and 11 deletions
+2 -4
View File
@@ -826,12 +826,10 @@ class core_competency_external_testcase extends externallib_advanced_testcase {
'competencyframeworkid' => $framework->id,
'sortorder' => 0
);
// TODO: MDL-69700 - Analyse if the throw exception is happening
// in the correct place and decide what happens with the trailing
// code that is never executed.
$this->expectException(invalid_parameter_exception::class);
$this->expectExceptionMessage('Invalid external api parameter');
$result = external::create_competency($competency);
$result = (object) external_api::clean_returnvalue(external::create_competency_returns(), $result);
}
/**
+4 -7
View File
@@ -103,20 +103,17 @@ class core_exporter_testcase extends advanced_testcase {
$exporter = new core_testable_exporter($this->invaliddata, $this->validrelated);
$output = $PAGE->get_renderer('core');
// The exception message is a bit misleading, it actually indicates an expected property wasn't found.
$this->expectException(coding_exception::class);
$this->expectExceptionMessage('Unexpected property stringAformat');
$result = $exporter->export($output);
}
public function test_invalid_related() {
global $PAGE;
// TODO: MDL-69700 - Analyse if the throw exception is happening
// in the correct place and decide what happens with the trailing
// code that is never executed.
$this->expectException(coding_exception::class);
$this->expectExceptionMessage('Exporter class is missing required related data: (core_testable_exporter) ' .
'simplestdClass => stdClass');
$exporter = new core_testable_exporter($this->validdata, $this->invalidrelated);
$output = $PAGE->get_renderer('core');
$result = $exporter->export($output);
}
public function test_invalid_related_all_cases() {