Skip to content

Commit

Permalink
Merge branch 'MDL-69700-311' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_311_STABLE
  • Loading branch information
junpataleta committed Jan 6, 2022
2 parents ca560fd + c96d329 commit a569efe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
6 changes: 2 additions & 4 deletions competency/tests/external_test.php
Expand Up @@ -826,12 +826,10 @@ public function test_create_competency_with_nasty_data() {
'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);
}

/**
Expand Down
11 changes: 4 additions & 7 deletions lib/tests/exporter_test.php
Expand Up @@ -103,20 +103,17 @@ public function test_invalid_data() {
$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() {
Expand Down

0 comments on commit a569efe

Please sign in to comment.