Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 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: 3 times
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.