Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Tests for the the Forum gradeitem.

Copyright: Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 277 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 mod/forum/tests/generator_trait.php

Defines 1 class


Class: forum_gradeitem_test  - X-Ref

Tests for the the Forum gradeitem.

test_get_grade_for_user_exists()   X-Ref
Test fetching of a grade for a user when the grade has been created.


test_user_has_grade()   X-Ref
Test fetching of a grade for a user when the grade has been created.


test_get_and_store_grade_for_user_with_simple_direct_grade()   X-Ref
Ensure that it is possible to get, and update, a grade for a user when simple direct grading is in use.


test_get_and_store_grade_for_user_with_rubric()   X-Ref
Ensure that it is possible to get, and update, a grade for a user when a rubric is in use.


test_should_grade_only_active_users(bool $showonlyactiveenrolconfig, bool $showonlyactiveenrolpreference,bool $viewsuspendeduserscapability, bool $expected)   X-Ref
Test the logic in the should_grade_only_active_users() method.

param: bool $showonlyactiveenrolconfig Whether the 'grade_report_showonlyactiveenrol' is enabled or not.
param: bool $showonlyactiveenrolpreference Whether the 'grade_report_showonlyactiveenrol' preference is enabled or not.
param: bool $viewsuspendeduserscapability Whether the 'moodle/course:viewsuspendedusers' capability is allowed or not.
param: bool $expected The expected result.

should_grade_only_active_users_provider()   X-Ref
Data provider for test_should_grade_only_active_users.

return: array

get_forum_instance(array $config = [])   X-Ref
Get a forum instance.

param: array $config
return: forum_entity