mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-34472 phpunit: Make sure a debugging is thrown when get_context_instance() is called
This commit is contained in:
parent
bea86e845e
commit
bfb99cc619
1 changed files with 4 additions and 0 deletions
|
@ -2367,6 +2367,10 @@ class accesslib_testcase extends advanced_testcase {
|
||||||
$this->assertEquals(count($children), $DB->count_records('context')-1);
|
$this->assertEquals(count($children), $DB->count_records('context')-1);
|
||||||
unset($children);
|
unset($children);
|
||||||
|
|
||||||
|
// Make sure a debugging is thrown.
|
||||||
|
get_context_instance($record->contextlevel, $record->instanceid);
|
||||||
|
$this->assertDebuggingCalled('get_context_instance() is deprecated, please use respective context_xxxx::instance().', DEBUG_DEVELOPER);
|
||||||
|
|
||||||
$DB->delete_records('context', array('contextlevel'=>CONTEXT_BLOCK));
|
$DB->delete_records('context', array('contextlevel'=>CONTEXT_BLOCK));
|
||||||
create_contexts();
|
create_contexts();
|
||||||
$this->assertFalse($DB->record_exists('context', array('contextlevel'=>CONTEXT_BLOCK)));
|
$this->assertFalse($DB->record_exists('context', array('contextlevel'=>CONTEXT_BLOCK)));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue