Skip to content

Commit

Permalink
Fix CI complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
Fragonite committed Dec 10, 2024
1 parent c215b8e commit 00816a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions classes/local/datasource/restore/fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class fields {
/** @var \restore_cms_activity_structure_step The stepslib controlling this process. */
protected $stepslib;

/** @var array Components array */
protected $components = [];

/**
* Constructs the processor.
*
Expand Down
7 changes: 4 additions & 3 deletions tests/datasource_site_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ 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);
// Some versions of PHPUnit do not have assertObjectHasProperty(), and assertObjectHasAttribute() is deprecated.
$this->assertTrue(property_exists($data, 'fullname'));
$this->assertTrue(property_exists($data, 'shortname'));
$this->assertTrue(property_exists($data, 'wwwroot'));
}

/**
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->assertTrue(property_exists($data, $attribute));
$this->assertIsObject($data->$attribute);
}
}
Expand Down

0 comments on commit 00816a7

Please sign in to comment.