Skip to content

Commit 2bb44ca

Browse files
committed
fix unit tests
1 parent a742118 commit 2bb44ca

File tree

6 files changed

+25
-24
lines changed

6 files changed

+25
-24
lines changed

backup/moodle2/restore_moodleoverflow_activity_task.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public static function define_decode_rules() {
9595

9696
/**
9797
* Define the restore log rules that will be applied
98-
* by the {@link restore_logs_processor} when restoring
98+
* by the {restore_logs_processor} when restoring
9999
* moodleoverflow logs. It must return one array
100-
* of {@link restore_log_rule} objects
100+
* of { restore_log_rule} objects
101101
*/
102102
public static function define_restore_log_rules() {
103103
$rules = array();
@@ -151,9 +151,9 @@ public static function define_restore_log_rules() {
151151

152152
/**
153153
* Define the restore log rules that will be applied
154-
* by the {@link restore_logs_processor} when restoring
154+
* by the { restore_logs_processor} when restoring
155155
* course logs. It must return one array
156-
* of {@link restore_log_rule} objects
156+
* of { restore_log_rule} objects
157157
*
158158
* Note this rules are applied when restoring course logs
159159
* by the restore final task, but are defined here at

backup/moodle2/restore_moodleoverflow_stepslib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class restore_moodleoverflow_activity_structure_step extends restore_activity_st
3636
/**
3737
* Defines structure of path elements to be processed during the restore.
3838
*
39-
* @return array of {@link restore_path_element}
39+
* @return array of {restore_path_element}
4040
*/
4141
protected function define_structure() {
4242

lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
/**
8787
* Returns the information on whether the module supports a feature.
8888
*
89-
* See {@link plugin_supports()} for more info.
89+
* See {plugin_supports()} for more info.
9090
*
9191
* @param string $feature FEATURE_xx constant for requested feature
9292
*
@@ -359,7 +359,7 @@ function moodleoverflow_get_extra_capabilities() {
359359
* Returns the lists of all browsable file areas within the given module context.
360360
*
361361
* The file area 'intro' for the activity introduction field is added automatically
362-
* by {@link file_browser::get_file_info_context_module()}
362+
* by { file_browser::get_file_info_context_module()}
363363
*
364364
* @param stdClass $course
365365
* @param stdClass $cm

tests/privacy_provider_test.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
* @copyright 2018 Tamara Gunkel
2121
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2222
*/
23+
namespace mod_moodleoverflow;
24+
2325
defined('MOODLE_INTERNAL') || die();
24-
global $CFG;
2526

26-
namespace mod_moodleoverflow;
27+
global $CFG;
2728

2829
use core_privacy\local\request\approved_contextlist;
2930
use \core_privacy\local\request\userlist;
@@ -898,7 +899,7 @@ protected function create_courses_and_modules($count) {
898899
* course.
899900
* Users are enrolled as students.
900901
*
901-
* @param stdClass $course The course object
902+
* @param \stdClass $course The course object
902903
* @param integer $count The number of users to create
903904
*
904905
* @return array The users created
@@ -917,7 +918,7 @@ protected function create_users($course, $count) {
917918
/**
918919
* Creates and enrols users.
919920
*
920-
* @param stdClass $course The course to enrol users.
921+
* @param \stdClass $course The course to enrol users.
921922
* @param int $count The number of users to create.
922923
*
923924
* @return array The users created
@@ -1430,7 +1431,7 @@ public function test_grades() {
14301431
'gradescalefactor' => 2
14311432
]);
14321433
$cm = get_coursemodule_from_instance('moodleoverflow', $forum->id);
1433-
$context = context_module::instance($cm->id);
1434+
$context = \context_module::instance($cm->id);
14341435

14351436
list($user, $user2) = $this->create_and_enrol_users($course, 2);
14361437
list( , $post) = $this->generator->post_to_forum($forum, $user);

tests/review_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class review_test extends \advanced_testcase {
4545
/** @var \mod_moodleoverflow_generator $generator */
4646
private $generator;
4747
/**
48-
* @var \stdClass
48+
* @var \stdClass
4949
*/
5050
private $teacher;
5151
/**
52-
* @var \stdClass
52+
* @var \stdClass
5353
*/
5454
private $student;
5555
/**
56-
* @var \stdClass
56+
* @var \stdClass
5757
*/
5858
private $course;
5959
/**

tests/subscriptions_test.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function tearDown(): void {
6161
* Helper to create the required number of users in the specified course.
6262
* Users are enrolled as students.
6363
*
64-
* @param stdClass $course The course object
64+
* @param \stdClass $course The course object
6565
* @param int $count The number of users to create
6666
*
6767
* @return array The users created
@@ -81,8 +81,8 @@ protected function helper_create_users($course, $count) {
8181
/**
8282
* Crate a new discussion and post within the moodleoverflow.
8383
*
84-
* @param stdClass $moodleoverflow The moodleoverflow to post in
85-
* @param stdClass $author The author to post as
84+
* @param \stdClass $moodleoverflow The moodleoverflow to post in
85+
* @param \stdClass $author The author to post as
8686
*
8787
* @return array Array containing the discussion object and the post object.
8888
*/
@@ -93,7 +93,7 @@ protected function helper_post_to_moodleoverflow($moodleoverflow, $author) {
9393
$generator = $this->getDataGenerator()->get_plugin_generator('mod_moodleoverflow');
9494

9595
// Create a discussion in the moodleoverflow, add a post to that discussion.
96-
$record = new stdClass();
96+
$record = new \stdClass();
9797
$record->course = $moodleoverflow->course;
9898
$record->userid = $author->id;
9999
$record->moodleoverflow = $moodleoverflow->id;
@@ -119,7 +119,7 @@ public function test_subscription_modes() {
119119
$course = $this->getDataGenerator()->create_course();
120120
$options = array('course' => $course->id);
121121
$moodleoverflow = $this->getDataGenerator()->create_module('moodleoverflow', $options);
122-
$modulecontext = context_module::instance($moodleoverflow->cmid);
122+
$modulecontext = \context_module::instance($moodleoverflow->cmid);
123123

124124
// Create a user enrolled in the course as a student.
125125
list ($user) = $this->helper_create_users($course, 1);
@@ -927,7 +927,7 @@ public function test_fetch_subscribed_users_discussion_subscriptions() {
927927
$this->assertEquals($usercount, count($subscribers));
928928

929929
// Manually insert an extra subscription for one of the users.
930-
$record = new stdClass();
930+
$record = new \stdClass();
931931
$record->userid = $users[2]->id;
932932
$record->moodleoverflow = $moodleoverflow->id;
933933
$record->discussion = $discussion->id;
@@ -1406,7 +1406,7 @@ public function test_is_subscribable_logged_out($options) {
14061406
$moodleoverflow = $this->getDataGenerator()->create_module('moodleoverflow', $options);
14071407

14081408
$this->assertFalse(\mod_moodleoverflow\subscriptions::is_subscribable($moodleoverflow,
1409-
context_module::instance($moodleoverflow->cmid)));
1409+
\context_module::instance($moodleoverflow->cmid)));
14101410
}
14111411

14121412
/**
@@ -1430,7 +1430,7 @@ public function test_is_subscribable_is_guest($options) {
14301430
$moodleoverflow = $this->getDataGenerator()->create_module('moodleoverflow', $options);
14311431

14321432
$this->assertFalse(\mod_moodleoverflow\subscriptions::is_subscribable($moodleoverflow,
1433-
context_module::instance($moodleoverflow->cmid)));
1433+
\context_module::instance($moodleoverflow->cmid)));
14341434
}
14351435

14361436
/**
@@ -1481,6 +1481,6 @@ public function test_is_subscribable_loggedin($options, $expect) {
14811481
$this->setUser($user);
14821482

14831483
$this->assertEquals($expect, \mod_moodleoverflow\subscriptions::is_subscribable($moodleoverflow,
1484-
context_module::instance($moodleoverflow->cmid)));
1484+
\context_module::instance($moodleoverflow->cmid)));
14851485
}
14861486
}

0 commit comments

Comments
 (0)