File tree 3 files changed +8
-4
lines changed
classes/local/datasource/restore
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ class fields {
32
32
/** @var \restore_cms_activity_structure_step The stepslib controlling this process. */
33
33
protected $ stepslib ;
34
34
35
+ /** @var array Components array */
36
+ protected $ components = [];
37
+
35
38
/**
36
39
* Constructs the processor.
37
40
*
Original file line number Diff line number Diff line change @@ -62,9 +62,10 @@ public function test_get_data() {
62
62
$ ds = new dssite ($ cms );
63
63
$ data = $ ds ->get_data ();
64
64
65
- $ this ->assertObjectHasAttribute ('fullname ' , $ data );
66
- $ this ->assertObjectHasAttribute ('shortname ' , $ data );
67
- $ this ->assertObjectHasAttribute ('wwwroot ' , $ data );
65
+ // Some versions of PHPUnit do not have assertObjectHasProperty(), and assertObjectHasAttribute() is deprecated.
66
+ $ this ->assertTrue (property_exists ($ data , 'fullname ' ));
67
+ $ this ->assertTrue (property_exists ($ data , 'shortname ' ));
68
+ $ this ->assertTrue (property_exists ($ data , 'wwwroot ' ));
68
69
}
69
70
70
71
/**
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ public function test_get_data() {
67
67
foreach (dsbase::BUILTIN_DATASOURCES as $ ds ) {
68
68
$ classname = 'mod_cms \\local \\datasource \\' . $ ds ;
69
69
$ attribute = $ classname ::get_shortname ();
70
- $ this ->assertObjectHasAttribute ( $ attribute , $ data );
70
+ $ this ->assertTrue ( property_exists ( $ data , $ attribute ) );
71
71
$ this ->assertIsObject ($ data ->$ attribute );
72
72
}
73
73
}
You can’t perform that action at this time.
0 commit comments