mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-52284 core: compatibility with Exception/Throwable changes in PHP7
This commit is contained in:
parent
0dfcc2541a
commit
d74b7e424f
7 changed files with 43 additions and 8 deletions
|
@ -126,6 +126,8 @@ class backp_settings_testcase extends basic_testcase {
|
|||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof base_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// PHP7 will catch type errors for us.
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
|
@ -140,6 +142,8 @@ class backp_settings_testcase extends basic_testcase {
|
|||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof base_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// PHP7 will catch type errors for us.
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
|
@ -302,6 +306,8 @@ class backp_settings_testcase extends basic_testcase {
|
|||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof backup_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// PHP7 will catch type errors for us.
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue