MDL-31006 revert partially @ get_config()
The change from null to stdClass() in get_config() was leading to: 1) unit tests not passing. 2) non-equivalent evaluation in conditions (null evals false, stdClassi() evals true)
This commit is contained in:
committed by
kordan
parent
63abec4487
commit
fe0bc2e0be
+1
-1
@@ -1318,7 +1318,7 @@ function get_config($plugin, $name = NULL) {
|
||||
if ($localcfg) {
|
||||
return (object)$localcfg;
|
||||
} else {
|
||||
return new stdClass();
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -747,7 +747,7 @@ class filter_delete_config_test extends UnitTestCaseUsingDatabase {
|
||||
$expectedconfig = new stdClass;
|
||||
$expectedconfig->configname = 'Other config value';
|
||||
$this->assertEqual($expectedconfig, get_config('filter_other'));
|
||||
$this->assertFalse(get_config('filter_name'));
|
||||
$this->assertNull(get_config('filter_name'));
|
||||
}
|
||||
|
||||
public function test_filter_delete_all_for_context() {
|
||||
|
||||
Reference in New Issue
Block a user