From aae0a865bbc97cb88fbe266e54c5fa17ebe45243 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Mon, 3 Apr 2017 09:23:58 +0530 Subject: [PATCH] MDL-58465 unittests: Fix invalid use of exception --- course/tests/externallib_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index af551490dec..6b3e8ac91e7 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -483,7 +483,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertEquals($courseinfo->numsections, $course3options['numsections']); $this->assertEquals($courseinfo->coursedisplay, $course3options['coursedisplay']); } else { - throw moodle_exception('Unexpected shortname'); + throw new moodle_exception('Unexpected shortname'); } } @@ -1137,7 +1137,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertEquals(0, $courseinfo->newsitems); $this->assertEquals(FORMAT_MOODLE, $courseinfo->summaryformat); } else { - throw moodle_exception('Unexpected shortname'); + throw new moodle_exception('Unexpected shortname'); } }