Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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