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.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Base class for unit tests for mod_assign.

Copyright: 2018 Adrian Greeve <adrian@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 815 lines (35 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: provider_test  - X-Ref

Unit tests for mod/assign/classes/privacy/

create_submission($assign, $user, $submissiontext, $attemptnumber = 0)   X-Ref
Convenience method for creating a submission.

param: assign  $assign The assign object
param: stdClass  $user The user object
param: string  $submissiontext Submission text
param: integer $attemptnumber The attempt number
return: object A submission object.

create_instance($params = array()   X-Ref
Convenience function to create an instance of an assignment.

param: array $params Array of parameters to pass to the generator
return: assign The assign class.

test_get_contexts_for_userid()   X-Ref
Test that getting the contexts for a user works.


test_get_users_in_context()   X-Ref
Test returning a list of user IDs related to a context (assign).


test_export_user_data_student()   X-Ref
Test that a student with multiple submissions and grades is returned with the correct data.


test_export_user_data_teacher()   X-Ref
Tests the data returned for a teacher.


test_delete_data_for_all_users_in_context()   X-Ref
A test for deleting all user data for a given context.


test_delete_data_for_user()   X-Ref
A test for deleting all user data for one user.


test_delete_data_for_users()   X-Ref
A test for deleting all user data for a bunch of users.