Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403]

(no description)

File Size: 670 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

report_test:: (10 methods):
  test_query_db()
  test_get_users()
  get_users_with_profile_fields_provider()
  test_get_users_with_profile_fields()
  get_users_provider()
  test_get_users_with_groups()
  test_graders()
  assertGradeHistoryIds()
  create_grade_history()
  get_tablelog_results()

gradereport_history_tests_tablelog:: (1 method):
  get_test_results()


Class: report_test  - X-Ref

Grade history report test class.

test_query_db()   X-Ref
Create some grades.


test_get_users()   X-Ref
Test the get users helper method.


get_users_with_profile_fields_provider()   X-Ref
Data provider for \gradereport_history_report_testcase::test_get_users_with_profile_fields()
Testing get_users() and get_users_count() test cases.

return: array List of data sets (test cases)

test_get_users_with_profile_fields(string $showuseridentity, string $searchstring,array $expectedusernames)   X-Ref
Testing the search functionality on get_users() and get_users_count() and their inner methods.

param: string $showuseridentity, list of user identities to be shown.
param: string $searchstring, the string to be searched.
param: array $expectedusernames, a list of expected usernames.
return: void

get_users_provider()   X-Ref
Data provider method for \gradereport_history_report_testcase::test_get_users_with_groups()


test_get_users_with_groups($groupmode, $teacherrole, $teachergroups, $expectedusers)   X-Ref
Test for helper::get_users() with course group mode set.

param: $groupmode
param: $teacherrole
param: $teachergroups
param: $expectedusers

test_graders()   X-Ref
Test the get graders helper method.


assertGradeHistoryIds(array $expectedids, array $objects)   X-Ref
Asserts that the array of grade objects contains exactly the right IDs.

param: array $expectedids Array of expected IDs.
param: array $objects Array of objects returned by the table.

create_grade_history($params)   X-Ref
Create a new grade history entry.

param: array $params Of values.
return: object The grade object.

get_tablelog_results($coursecontext, $filters = array()   X-Ref
Returns a table log object.

param: context_course $coursecontext The course context.
param: array $filters An array of filters.
param: boolean $count When true, returns a count rather than an array of objects.
return: mixed Count or array of objects.

Class: gradereport_history_tests_tablelog  - X-Ref

Extended table log class.

get_test_results($count = false)   X-Ref
Get the test results.

param: boolean $count Whether or not we want the count.
return: mixed Count or array of objects.