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

File containing tests for the course class.

Copyright: 2013 Frédéric Massart
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1503 lines (74 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: tool_uploadcourse_course_testcase  - 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_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

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