From 341ec5ba813339bdf127ebd978d3f003e45fac79 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Sun, 7 Apr 2024 23:31:26 +0800 Subject: [PATCH] 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 --- enrol/tests/externallib_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/enrol/tests/externallib_test.php b/enrol/tests/externallib_test.php index 0a13b95ab5f..67b8dc6c3ce 100644 --- a/enrol/tests/externallib_test.php +++ b/enrol/tests/externallib_test.php @@ -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);