Skip to content

Commit 8a8fe2e

Browse files
committed
Fix assertObjectHasAttribute deprecation warning (Moodle 4.5 compatibility)
1 parent ab27766 commit 8a8fe2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/datasource_site_test.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function test_get_data() {
6262
$ds = new dssite($cms);
6363
$data = $ds->get_data();
6464

65-
$this->assertObjectHasAttribute('fullname', $data);
66-
$this->assertObjectHasAttribute('shortname', $data);
67-
$this->assertObjectHasAttribute('wwwroot', $data);
65+
$this->assertObjectHasProperty('fullname', $data);
66+
$this->assertObjectHasProperty('shortname', $data);
67+
$this->assertObjectHasProperty('wwwroot', $data);
6868
}
6969

7070
/**

tests/renderer_test.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function test_get_data() {
6767
foreach (dsbase::BUILTIN_DATASOURCES as $ds) {
6868
$classname = 'mod_cms\\local\\datasource\\' . $ds;
6969
$attribute = $classname::get_shortname();
70-
$this->assertObjectHasAttribute($attribute, $data);
70+
$this->assertObjectHasProperty($attribute, $data);
7171
$this->assertIsObject($data->$attribute);
7272
}
7373
}

0 commit comments

Comments
 (0)