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 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 2836 lines (131 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 mod/assign/tests/fixtures/testable_assign.php

Defines 1 class

externallib_test:: (48 methods):
  test_get_grades()
  test_get_assignments()
  test_get_assignments_with_submissionstatement()
  test_get_submissions()
  test_get_submissions_group_submission()
  test_get_submissions_group_submission_attemptnumber()
  test_get_user_flags()
  test_get_user_mappings()
  test_lock_submissions()
  test_unlock_submissions()
  test_submit_for_grading()
  test_save_user_extensions()
  test_reveal_identities()
  test_revert_submissions_to_draft()
  test_save_submission()
  test_save_grade()
  test_save_grades_with_advanced_grading()
  test_save_grades_with_group_submission()
  test_copy_previous_attempt()
  test_set_user_flags()
  test_view_grading_table_invalid_instance()
  test_view_grading_table_not_enrolled()
  test_view_grading_table_correct()
  test_view_grading_table_without_capability()
  test_subplugins_availability()
  test_view_submission_status()
  create_submission_for_testing_status()
  test_get_submission_status_in_draft_status()
  test_get_submission_status_in_submission_status()
  test_get_submission_status_in_submission_status_for_teacher()
  test_get_submission_status_in_reopened_status()
  test_get_submission_status_access_control()
  test_get_submission_status_hidden_grader()
  test_get_submission_status_with_override()
  test_get_participant_no_assignment()
  test_get_participant_no_view_capability()
  test_get_participant_no_grade_capability()
  test_get_participant_no_participant()
  test_get_participant_blind_marking()
  test_get_participant_no_user()
  test_get_participant_full_details()
  test_get_participant_group_submission()
  test_get_participant_relative_dates()
  get_participant_relative_dates_provider()
  test_list_participants_user_info_with_special_characters()
  test_list_participants_returns_user_property_types()
  create_assign_with_student_and_teacher()
  test_view_assign()


Class: externallib_test  - X-Ref

External mod assign functions unit tests

test_get_grades()   X-Ref
Test get_grades


test_get_assignments()   X-Ref
Test get_assignments


test_get_assignments_with_submissionstatement()   X-Ref
Test get_assignments with submissionstatement.


test_get_submissions()   X-Ref
Test get_submissions


test_get_submissions_group_submission()   X-Ref
Test get_submissions with teamsubmission enabled


test_get_submissions_group_submission_attemptnumber()   X-Ref
Test get_submissions with teamsubmission enabled
and a group having a higher attemptnumber than another


test_get_user_flags()   X-Ref
Test get_user_flags


test_get_user_mappings()   X-Ref
Test get_user_mappings


test_lock_submissions()   X-Ref
Test lock_submissions


test_unlock_submissions()   X-Ref
Test unlock_submissions


test_submit_for_grading()   X-Ref
Test submit_for_grading


test_save_user_extensions()   X-Ref
Test save_user_extensions


test_reveal_identities()   X-Ref
Test reveal_identities


test_revert_submissions_to_draft()   X-Ref
Test revert_submissions_to_draft


test_save_submission()   X-Ref
Test save_submission


test_save_grade()   X-Ref
Test save_grade


test_save_grades_with_advanced_grading()   X-Ref
Test save grades with advanced grading data


test_save_grades_with_group_submission()   X-Ref
Test save grades for a team submission


test_copy_previous_attempt()   X-Ref
Test copy_previous_attempt


test_set_user_flags()   X-Ref
Test set_user_flags


test_view_grading_table_invalid_instance()   X-Ref
Test view_grading_table


test_view_grading_table_not_enrolled()   X-Ref
Test view_grading_table


test_view_grading_table_correct()   X-Ref
Test view_grading_table


test_view_grading_table_without_capability()   X-Ref
Test view_grading_table


test_subplugins_availability()   X-Ref
Test subplugins availability


test_view_submission_status()   X-Ref
Test test_view_submission_status


create_submission_for_testing_status($submitforgrading = false)   X-Ref
Create a submission for testing the get_submission_status function.

param: boolean $submitforgrading whether to submit for grading the submission
return: array an array containing all the required data for testing

test_get_submission_status_in_draft_status()   X-Ref
Test get_submission_status for a draft submission.


test_get_submission_status_in_submission_status()   X-Ref
Test get_submission_status for a submitted submission.


test_get_submission_status_in_submission_status_for_teacher()   X-Ref
Test get_submission_status using the teacher role.


test_get_submission_status_in_reopened_status()   X-Ref
Test get_submission_status for a reopened submission.


test_get_submission_status_access_control()   X-Ref
Test access control for get_submission_status.


test_get_submission_status_hidden_grader()   X-Ref
Test hidden grader for get_submission_status.


test_get_submission_status_with_override()   X-Ref
Test get_submission_status with override for student.


test_get_participant_no_assignment()   X-Ref
get_participant should throw an excaption if the requested assignment doesn't exist.


test_get_participant_no_view_capability()   X-Ref
get_participant should throw a require_login_exception if the user doesn't have access
to view assignments.


test_get_participant_no_grade_capability()   X-Ref
get_participant should throw a required_capability_exception if the user doesn't have access
to view assignment grades.


test_get_participant_no_participant()   X-Ref
get_participant should throw an exception if the user isn't enrolled in the course.


test_get_participant_blind_marking()   X-Ref
get_participant should return a summarised list of details with a different fullname if blind
marking is on for the requested assignment.


test_get_participant_no_user()   X-Ref
get_participant should return a summarised list of details if requested.


test_get_participant_full_details()   X-Ref
get_participant should return user details if requested.


test_get_participant_group_submission()   X-Ref
get_participant should return group details if a group submission was
submitted.


test_get_participant_relative_dates(array $courseconfig, array $assignconfig, array $enrolconfig,array $expectedproperties)   X-Ref
Test get_participant() when relative dates mode is enabled on the course.

param: array $courseconfig the config to use when creating the course.
param: array $assignconfig the config to use when creating the assignment.
param: array $enrolconfig the enrolement to create.
param: array $expectedproperties array of expected assign properties.

get_participant_relative_dates_provider()   X-Ref
The test_get_participant_relative_dates data provider.


test_list_participants_user_info_with_special_characters()   X-Ref
Test for mod_assign_external::list_participants().


test_list_participants_returns_user_property_types()   X-Ref
Test for the type of the user-related properties in mod_assign_external::list_participants_returns().


create_assign_with_student_and_teacher($params = array()   X-Ref
Create a a course, assignment module instance, student and teacher and enrol them in
the course.

param: array $params parameters to be provided to the assignment module creation
return: array containing the course, assignment module, student and teacher

test_view_assign()   X-Ref
Test test_view_assign