Skip to content

Commit

Permalink
Fix assertObjectHasAttribute deprecation warning (Moodle 4.5 compatib…
Browse files Browse the repository at this point in the history
…ility)
  • Loading branch information
Fragonite committed Nov 28, 2024
1 parent ab27766 commit 8a8fe2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/datasource_site_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function test_get_data() {
$ds = new dssite($cms);
$data = $ds->get_data();

$this->assertObjectHasAttribute('fullname', $data);
$this->assertObjectHasAttribute('shortname', $data);
$this->assertObjectHasAttribute('wwwroot', $data);
$this->assertObjectHasProperty('fullname', $data);
$this->assertObjectHasProperty('shortname', $data);
$this->assertObjectHasProperty('wwwroot', $data);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/renderer_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function test_get_data() {
foreach (dsbase::BUILTIN_DATASOURCES as $ds) {
$classname = 'mod_cms\\local\\datasource\\' . $ds;
$attribute = $classname::get_shortname();
$this->assertObjectHasAttribute($attribute, $data);
$this->assertObjectHasProperty($attribute, $data);
$this->assertIsObject($data->$attribute);
}
}
Expand Down

0 comments on commit 8a8fe2e

Please sign in to comment.