From a63ffed1bcc46e05a6b3e7d04d6c29a65fb1b939 Mon Sep 17 00:00:00 2001 From: Sasha Anastasi Date: Thu, 20 Feb 2025 12:33:01 +1300 Subject: [PATCH] outagelib: adjust exception trigger for phpunit10 --- classes/local/outagelib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index 82cab6a..606296d 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -266,7 +266,9 @@ class outagelib { // Used to test the try block in case of errors. if (PHPUNIT_TEST && optional_param('auth_outage_break_code', false, PARAM_INT)) { - (new stdClass())->invalidfield; // Triggers an exception. + if (!isset($emptyvar)) { + throw new coding_exception('Empty variable "emptyvar" is empty'); + } } // Nothing preventing the injection.