MDL-52471 setuplib: depreciate class object properly
Previously was marked depricated but not throwwing debugging
This commit is contained in:
+8
-1
@@ -63,7 +63,14 @@ define('MEMORY_HUGE', -4);
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @deprecated since 2.0
|
||||
*/
|
||||
class object extends stdClass {};
|
||||
class object extends stdClass {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
debugging("'object' class has been deprecated, please use stdClass instead.", DEBUG_DEVELOPER);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Base Moodle Exception class
|
||||
|
||||
@@ -460,4 +460,10 @@ class core_setuplib_testcase extends advanced_testcase {
|
||||
return get_exception_info($e);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_object() {
|
||||
$obj = new object();
|
||||
$this->assertDebuggingCalled("'object' class has been deprecated, please use stdClass instead.");
|
||||
$this->assertInstanceOf('stdClass', $obj);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user