Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310]

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: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_assign_privacy_testcase  - 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.