File tree 6 files changed +82
-6
lines changed
6 files changed +82
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ // This file is part of Moodle - https://moodle.org/
3
+ //
4
+ // Moodle is free software: you can redistribute it and/or modify
5
+ // it under the terms of the GNU General Public License as published by
6
+ // the Free Software Foundation, either version 3 of the License, or
7
+ // (at your option) any later version.
8
+ //
9
+ // Moodle is distributed in the hope that it will be useful,
10
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ // GNU General Public License for more details.
13
+ //
14
+ // You should have received a copy of the GNU General Public License
15
+ // along with Moodle. If not, see <https://www.gnu.org/licenses/>.
16
+
17
+ namespace mod_cms ;
18
+
19
+ /**
20
+ * Hook callbacks for tool_redirects.
21
+ *
22
+ * @package mod_cms
23
+ * @author Alexander Van der Bellen <[email protected] >
24
+ * @copyright 2024 Catalyst IT Australia
25
+ * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
+ */
27
+ class hook_callbacks {
28
+
29
+ /**
30
+ * Listener for the after_config hook.
31
+ *
32
+ * @param \core\hook\after_config $hook
33
+ */
34
+ public static function after_config (\core \hook \after_config $ hook ): void {
35
+ global $ CFG ;
36
+
37
+ require_once ($ CFG ->dirroot . '/vendor/autoload.php ' );
38
+ }
39
+ }
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
1
+ <?php
2
+ // This file is part of Moodle - http://moodle.org/
3
+ //
4
+ // Moodle is free software: you can redistribute it and/or modify
5
+ // it under the terms of the GNU General Public License as published by
6
+ // the Free Software Foundation, either version 3 of the License, or
7
+ // (at your option) any later version.
8
+ //
9
+ // Moodle is distributed in the hope that it will be useful,
10
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ // GNU General Public License for more details.
13
+ //
14
+ // You should have received a copy of the GNU General Public License
15
+ // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+ /**
18
+ * Hook callbacks.
19
+ *
20
+ * @package mod_cms
21
+ * @author Alexander Van der Bellen <[email protected] >
22
+ * @copyright 2024 Catalyst IT Australia
23
+ * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
+ */
25
+
26
+ defined ('MOODLE_INTERNAL ' ) || die ();
27
+
28
+ $ callbacks = [
29
+ [
30
+ 'hook ' => \core \hook \after_config::class,
31
+ 'callback ' => '\mod_cms\hook_callbacks::after_config ' ,
32
+ ],
33
+ ];
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
}
Original file line number Diff line number Diff line change 25
25
26
26
defined ('MOODLE_INTERNAL ' ) || die ();
27
27
28
- $ plugin ->version = 2024090305 ;
28
+ $ plugin ->version = 2024090306 ;
29
29
$ plugin ->requires = 2022112800 ; // Moodle 4.1 and above.
30
- $ plugin ->supported = [401 , 401 ]; // Moodle 4.1.
30
+ $ plugin ->supported = [401 , 405 ]; // Moodle 4.1.
31
31
$ plugin ->component = 'mod_cms ' ;
32
32
$ plugin ->maturity = MATURITY_STABLE ;
33
33
$ plugin ->release = 2023051800 ;
You can’t perform that action at this time.
0 commit comments