From 7662c15e56b8473687b27813b43c47937614de36 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Thu, 5 Sep 2024 03:25:12 +1000 Subject: [PATCH] MDL-81909 mod_assign: Additional doc and styling fixes --- mod/assign/tests/locallib_test.php | 40 ++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/mod/assign/tests/locallib_test.php b/mod/assign/tests/locallib_test.php index d0027eaa8ab..b4b394f87ae 100644 --- a/mod/assign/tests/locallib_test.php +++ b/mod/assign/tests/locallib_test.php @@ -18,7 +18,7 @@ * Unit tests for (some of) mod/assign/locallib.php. * * @package mod_assign - * @category phpunit + * @category test * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -147,9 +147,9 @@ final class locallib_test extends \advanced_testcase { /** * Data provider for test_get_assign_perpage * - * @return array Provider data + * @return array[] Provider data */ - public static function get_assign_perpage_provider() { + public static function get_assign_perpage_provider(): array { return [ [ 'maxperpage' => -1, @@ -942,9 +942,9 @@ final class locallib_test extends \advanced_testcase { /** * Dataprovider for the test_new_submission_empty testcase * - * @return array of testcases + * @return array[] An array of testcases */ - public static function new_submission_empty_testcases() { + public static function new_submission_empty_testcases(): array { return [ 'With file and onlinetext' => [ [ @@ -2472,7 +2472,11 @@ final class locallib_test extends \advanced_testcase { // No feedback should be available because the grade is hidden. $this->setUser($student); $output = $assign->view_student_summary($student, true); - $this->assertDoesNotMatchRegularExpression('/Feedback/', $output, 'Do not show feedback if the grade is hidden in the gradebook'); + $this->assertDoesNotMatchRegularExpression( + '/Feedback/', + $output, + 'Do not show feedback if the grade is hidden in the gradebook' + ); // Show the feedback again - it should still be visible even in a frozen context. $this->setUser($teacher); @@ -3192,7 +3196,12 @@ final class locallib_test extends \advanced_testcase { $this->assertEquals($isenabled, (bool) $plugin->is_enabled('enabled')); } - public static function submission_plugin_settings_provider() { + /** + * Data provider for test_submission_comment_plugin_settings. + * + * @return array[] + */ + public static function submission_plugin_settings_provider(): array { return [ 'CFG->usecomments true, empty config => Enabled by default' => [ true, @@ -3327,7 +3336,12 @@ Anchor link 2:Link text $this->assertEquals($isenabled, (bool) $plugin->is_enabled('enabled')); } - public static function feedback_plugin_settings_provider() { + /** + * Data provider for test_feedback_plugin_settings. + * + * @return array[] + */ + public static function feedback_plugin_settings_provider(): array { return [ 'No configuration => disabled' => [ [], @@ -4072,7 +4086,7 @@ Anchor link 2:Link text * Data provider for test_fix_null_grades * @return array[] Test data for test_fix_null_grades. Each element should contain grade, expectedcount and gradebookvalue */ - public static function fix_null_grades_provider() { + public static function fix_null_grades_provider(): array { return [ 'Negative less than one is errant' => [ 'grade' => -0.64, @@ -4261,8 +4275,10 @@ Anchor link 2:Link text /** * The test_assign_get_instance data provider. + * + * @return array[] */ - public static function assign_get_instance_provider() { + public static function assign_get_instance_provider(): array { $timenow = time(); // The get_default_instance() method shouldn't calculate any properties per-user. It should just return the record data. @@ -4346,8 +4362,10 @@ Anchor link 2:Link text /** * The test_assign_get_default_instance data provider. + * + * @return array[] */ - public static function assign_get_default_instance_provider() { + public static function assign_get_default_instance_provider(): array { $timenow = time(); // The get_default_instance() method shouldn't calculate any properties per-user. It should just return the record data.