Search moodle.org's
Developer Documentation

See Release Notes

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

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

(no description)

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

Defines 1 class


Class: course_test  - X-Ref

Course test case.

test_proceed_without_prepare()   X-Ref
No description

test_proceed_when_prepare_failed()   X-Ref
No description

test_proceed_when_already_started()   X-Ref
No description

test_invalid_shortname()   X-Ref
No description

test_invalid_shortname_too_long()   X-Ref
No description

test_invalid_fullname_too_long()   X-Ref
No description

test_invalid_visibility()   X-Ref
No description

test_downloadcontent_disabled()   X-Ref
Test setting 'downloadcontent' field when the feature is globally disabled


test_downloadcontent_capability()   X-Ref
Test setting 'downloadcontent' field when user doesn't have required capability


test_downloadcontent_invalid()   X-Ref
Test setting 'downloadcontent' field to an invalid value


test_create()   X-Ref
No description

test_create_with_sections()   X-Ref
No description

test_delete()   X-Ref
No description

test_update()   X-Ref
No description

test_data_saved()   X-Ref
No description

test_default_data_saved()   X-Ref
No description

test_rename()   X-Ref
No description

test_restore_course()   X-Ref
No description

test_restore_file()   X-Ref
No description

test_restore_file_settings()   X-Ref
Test that specifying course template respects default restore settings


test_restore_invalid_file()   X-Ref
No description

test_restore_invalid_course()   X-Ref
No description

test_reset()   X-Ref
Testing the reset on groups, group members and enrolments.


test_create_bad_category()   X-Ref
No description

test_enrolment_data()   X-Ref
No description

enrolment_uploaddata_error_provider()   X-Ref
Data provider for testing enrolment errors

return: array

test_enrolment_error_create_course(string $expectederror, array $uploaddata)   X-Ref
Test that user without permission, cannot modify enrolment instances when creating courses

param: string $expectederror
param: array $uploaddata

test_enrolment_error_update_course(string $expectederror, array $uploaddata)   X-Ref
Test that user without permission, cannot modify enrolment instances when updating courses

param: string $expectederror
param: array $uploaddata

test_custom_fields_data()   X-Ref
Test upload processing of course custom fields


test_custom_fields_data_required()   X-Ref
Test upload processing of course custom field that is required but empty


test_custom_fields_data_invalid_select_option()   X-Ref
Test upload processing of course custom field with an invalid select option


test_custom_fields_data_invalid_date()   X-Ref
Test upload processing of course custom field with an out of range date


test_idnumber_problems()   X-Ref
No description

test_generate_shortname()   X-Ref
No description

test_mess_with_frontpage()   X-Ref
No description

test_role_not_exist()   X-Ref
Test when role doesn't exist.


test_role_not_allowed()   X-Ref
Test when role not allowed in course context.


test_role_allowed()   X-Ref
Test when role is allowed.


get_customfield_generator()   X-Ref
Get custom field plugin generator

return: core_customfield_generator

create_custom_field(\core_customfield\category_controller $category, string $type, string $shortname,array $configdata = [])   X-Ref
Helper method to create custom course field

param: \core_customfield\category_controller $category
param: string $type
param: string $shortname
param: array $configdata
return: \core_customfield\field_controller