MDL-81457 core: Do not mark tests as Incomplete when they are wrong

This check was marking a test as Incomplete if there was a bug in any
part of the test, rather than failing the test in such a way that the
test bug may be found.

https://docs.phpunit.de/en/9.6/incomplete-and-skipped-tests.html
This commit is contained in:
Andrew Nicols
2024-04-08 08:46:59 +08:00
parent c0038b965e
commit 341ec5ba81
+2 -1
View File
@@ -328,8 +328,9 @@ class externallib_test extends externallib_advanced_testcase {
$this->expectExceptionMessage($exception['message']);
} else {
// Failed, only canview and exception are supported.
$this->markTestIncomplete('Incomplete, only canview and exception are supported');
throw new \coding_exception('Incomplete, only canview and exception are supported');
}
// Switch to the user and assign the role.
$this->setUser(${$user});
role_assign($roleid, $USER->id, $coursecontext);