Merge branch 'MDL-69993' of git://github.com/paulholden/moodle into master
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 26 Oct 2020 09:42:31 +0000 (10:42 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 26 Oct 2020 09:42:31 +0000 (10:42 +0100)
698 files changed:
.gitignore
admin/classes/form/testoutgoingmailconf_form.php
admin/classes/local/settings/filesize.php
admin/roles/tests/privacy_test.php
admin/settings/analytics.php
admin/settings/courses.php
admin/settings/server.php
admin/templates/setting_configcheckbox.mustache
admin/templates/setting_configcolourpicker.mustache
admin/templates/setting_configdirectory.mustache
admin/templates/setting_configduration.mustache
admin/templates/setting_configexecutable.mustache
admin/templates/setting_configfile.mustache
admin/templates/setting_configfilesize.mustache
admin/templates/setting_configmultiselect.mustache
admin/templates/setting_configmultiselect_optgroup.mustache
admin/templates/setting_configpasswordunmask.mustache
admin/templates/setting_configselect.mustache
admin/templates/setting_configselect_optgroup.mustache
admin/templates/setting_configtext.mustache
admin/templates/setting_configtextarea.mustache
admin/templates/setting_configtime.mustache
admin/tests/behat/language_settings.feature [new file with mode: 0644]
admin/tool/analytics/tests/external_test.php
admin/tool/behat/tests/manager_util_test.php
admin/tool/capability/tests/events_test.php
admin/tool/cohortroles/tests/api_test.php
admin/tool/cohortroles/tests/privacy_test.php
admin/tool/dataprivacy/tests/api_test.php
admin/tool/dataprivacy/tests/expired_data_requests_test.php
admin/tool/dataprivacy/tests/manager_observer_test.php
admin/tool/dataprivacy/tests/privacy_provider_test.php
admin/tool/dataprivacy/tests/task_test.php
admin/tool/httpsreplace/tests/httpsreplace_test.php
admin/tool/installaddon/tests/installer_test.php
admin/tool/langimport/tests/events_test.php
admin/tool/log/store/database/tests/privacy_test.php
admin/tool/log/store/legacy/tests/privacy_test.php
admin/tool/log/store/standard/tests/privacy_test.php
admin/tool/log/store/standard/tests/store_test.php
admin/tool/log/tests/manager_test.php
admin/tool/log/tests/privacy_test.php
admin/tool/lp/tests/externallib_test.php
admin/tool/lpmigrate/tests/processor_test.php
admin/tool/messageinbound/tests/manager_test.php
admin/tool/messageinbound/tests/privacy_test.php
admin/tool/mobile/tests/api_test.php
admin/tool/mobile/tests/externallib_test.php
admin/tool/mobile/tests/privacy_provider_test.php
admin/tool/monitor/tests/eventobservers_test.php
admin/tool/monitor/tests/events_test.php
admin/tool/monitor/tests/generator_test.php
admin/tool/monitor/tests/privacy_test.php
admin/tool/monitor/tests/rule_manager_test.php
admin/tool/monitor/tests/subscription_test.php
admin/tool/monitor/tests/task_check_subscriptions_test.php
admin/tool/monitor/tests/task_clean_events_test.php
admin/tool/policy/tests/externallib_test.php
admin/tool/policy/tests/privacy_provider_test.php
admin/tool/recyclebin/tests/category_bin_test.php
admin/tool/recyclebin/tests/course_bin_test.php
admin/tool/recyclebin/tests/events_test.php
admin/tool/templatelibrary/tests/externallib_test.php
admin/tool/uploadcourse/tests/course_test.php
admin/tool/uploadcourse/tests/processor_test.php
admin/tool/usertours/tests/accessdate_filter_test.php
admin/tool/usertours/tests/cache_test.php
admin/tool/usertours/tests/manager_test.php
admin/tool/usertours/tests/privacy_provider_test.php
admin/tool/usertours/tests/role_filter_test.php
admin/tool/usertours/tests/step_test.php
admin/tool/usertours/tests/tour_test.php
analytics/classes/model.php
analytics/tests/course_test.php
analytics/tests/dataset_manager_test.php
analytics/tests/indicator_test.php
analytics/tests/model_test.php
analytics/tests/prediction_actions_test.php
analytics/tests/prediction_test.php
analytics/tests/privacy_test.php
analytics/tests/stats_test.php
auth/email/tests/external_test.php
auth/manual/tests/manual_test.php
auth/manual/tests/privacy_provider_test.php
auth/mnet/tests/privacy_provider_test.php
auth/oauth2/tests/auth_test.php
auth/oauth2/tests/privacy_provider_test.php
auth/tests/external_test.php
auth/tests/privacy_test.php
availability/condition/completion/tests/condition_test.php
availability/condition/date/tests/condition_test.php
availability/condition/grade/tests/condition_test.php
availability/condition/group/tests/condition_test.php
availability/condition/grouping/tests/condition_test.php
availability/condition/profile/tests/condition_test.php
availability/tests/info_test.php
availability/tests/tree_test.php
backup/controller/tests/controller_test.php
backup/converter/moodle1/tests/moodle1_converter_test.php
backup/moodle2/backup_activity_task.class.php
backup/moodle2/restore_activity_task.class.php
backup/moodle2/tests/backup_encrypted_content_test.php
backup/moodle2/tests/backup_xml_transformer_test.php
backup/tests/automated_backup_test.php
backup/tests/course_copy_test.php
backup/tests/externallib_test.php
backup/tests/privacy_provider_test.php
backup/util/checks/tests/checks_test.php
backup/util/dbops/tests/backup_dbops_test.php
backup/util/factories/tests/factories_test.php
backup/util/helper/tests/restore_structure_parser_processor_test.php
backup/util/plan/tests/plan_test.php
backup/util/plan/tests/step_test.php
backup/util/plan/tests/task_test.php
backup/util/structure/tests/structure_test.php
backup/util/ui/base_moodleform.class.php
badges/tests/badgeslib_test.php
badges/tests/external_test.php
badges/tests/privacy_test.php
blocks/comments/tests/events_test.php
blocks/comments/tests/privacy_provider_test.php
blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
blocks/online_users/tests/online_users_test.php
blocks/recentlyaccesseditems/tests/observer_test.php
blocks/rss_client/tests/cron_test.php
blocks/rss_client/tests/privacy_test.php
blocks/tests/privacy_test.php
blog/tests/events_test.php
blog/tests/external_test.php
blog/tests/lib_test.php
blog/tests/privacy_test.php
cache/stores/apcu/tests/apcu_test.php
cache/stores/redis/tests/compressor_test.php
cache/stores/redis/tests/redis_test.php
cache/tests/administration_helper_test.php
cache/tests/cache_test.php
cache/tests/config_writer_test.php
cache/tests/fixtures/stores.php
calendar/templates/month_detailed.mustache
calendar/tests/calendartype_test.php
calendar/tests/container_test.php
calendar/tests/events_related_objects_cache_test.php
calendar/tests/events_test.php
calendar/tests/externallib_test.php
calendar/tests/lib_test.php
calendar/tests/local_api_test.php
calendar/tests/privacy_test.php
calendar/tests/raw_event_retrieval_strategy_test.php
calendar/tests/rrule_manager_test.php
calendar/tests/std_proxy_test.php
cohort/tests/cohortlib_test.php
cohort/tests/externallib_test.php
cohort/tests/privacy_test.php
comment/tests/externallib_test.php
comment/tests/privacy_test.php
competency/tests/api_test.php
competency/tests/event_test.php
competency/tests/external_test.php
competency/tests/lib_test.php
competency/tests/plan_test.php
competency/tests/privacy_test.php
completion/tests/api_test.php
completion/tests/progress_test.php
composer.json
composer.lock
contentbank/contenttype/h5p/tests/contenttype_h5p_test.php
contentbank/tests/contentbank_test.php
contentbank/tests/contenttype_test.php
course/amd/build/downloadcontent.min.js [new file with mode: 0644]
course/amd/build/downloadcontent.min.js.map [new file with mode: 0644]
course/amd/src/downloadcontent.js [new file with mode: 0644]
course/classes/local/service/content_item_service.php
course/classes/output/content_export_link.php [new file with mode: 0644]
course/classes/search/customfield.php
course/downloadcontent.php [new file with mode: 0644]
course/edit_form.php
course/format/weeks/tests/observer_test.php
course/lib.php
course/tests/behat/course_download_content.feature [new file with mode: 0644]
course/tests/behat/course_download_content_permissions.feature [new file with mode: 0644]
course/tests/category_hooks_test.php
course/tests/category_test.php
course/tests/courselib_test.php
course/tests/customfield_test.php
course/tests/events_test.php
course/tests/externallib_test.php
course/tests/management_helper_test.php
course/tests/search_test.php
course/view.php
customfield/field/checkbox/tests/plugin_test.php
customfield/field/date/tests/plugin_test.php
customfield/field/select/tests/plugin_test.php
customfield/field/text/tests/plugin_test.php
customfield/field/textarea/tests/plugin_test.php
customfield/tests/privacy_test.php
enrol/flatfile/tests/privacy_provider_test.php
enrol/imsenterprise/tests/imsenterprise_test.php
enrol/lti/tests/data_connector_test.php
enrol/lti/tests/helper_test.php
enrol/lti/tests/lib_test.php
enrol/lti/tests/privacy_provider_test.php
enrol/lti/tests/sync_members_test.php
enrol/lti/tests/tool_provider_test.php
enrol/manual/tests/lib_test.php
enrol/meta/tests/privacy_test.php
enrol/paypal/tests/privacy_provider_test.php
enrol/self/tests/self_test.php
enrol/tests/course_enrolment_manager_test.php
enrol/tests/enrollib_test.php
enrol/tests/externallib_test.php
enrol/tests/role_external_test.php
favourites/tests/component_favourite_service_test.php
favourites/tests/privacy_test.php
favourites/tests/repository_test.php
favourites/tests/user_favourite_service_test.php
files/tests/conversion_test.php
filter/algebra/tests/filter_test.php
filter/displayh5p/tests/filter_test.php
filter/mediaplugin/tests/filter_test.php
filter/multilang/tests/filter_test.php
filter/tex/tests/filter_test.php
grade/export/ods/tests/logging_test.php
grade/export/txt/tests/logging_test.php
grade/export/xls/tests/logging_test.php
grade/export/xml/tests/logging_test.php
grade/grading/tests/grading_manager_test.php
grade/import/csv/tests/load_data_test.php
grade/report/grader/tests/privacy_test.php
grade/report/overview/tests/externallib_test.php
grade/report/user/tests/lib_test.php
grade/report/user/tests/privacy_test.php
grade/tests/edittreelib_test.php
grade/tests/events_test.php
grade/tests/grades_grader_gradingpanel_point_external_store_test.php
grade/tests/importlib_test.php
grade/tests/privacy_test.php
grade/tests/report_graderlib_test.php
group/tests/privacy_provider_test.php
h5p/tests/editor_ajax_test.php
h5p/tests/editor_framework_test.php
h5p/tests/event_h5p_deleted_test.php
h5p/tests/event_h5p_viewed_test.php
h5p/tests/external_test.php
h5p/tests/framework_test.php
h5p/tests/generator_test.php
h5p/tests/h5p_core_test.php
h5p/tests/h5p_file_storage_test.php
h5p/tests/helper_test.php
install/lang/mn/admin.php
iplookup/tests/geoip_test.php
iplookup/tests/geoplugin_test.php
lang/en/admin.php
lang/en/analytics.php
lang/en/course.php
lang/en/deprecated.txt
lang/en/error.php
lang/en/moodle.php
lang/en/role.php
lib/adminlib.php
lib/antivirus/clamav/tests/scanner_test.php
lib/blocklib.php
lib/classes/content.php
lib/classes/output/mustache_template_source_loader.php
lib/classes/plugin_manager.php
lib/classes/session/manager.php
lib/classes/string_manager_standard.php
lib/db/access.php
lib/db/install.xml
lib/db/upgrade.php
lib/ddl/tests/ddl_test.php
lib/dml/tests/dml_test.php
lib/dml/tests/pgsql_native_recordset_test.php
lib/dml/tests/recordset_walk_test.php
lib/dml/tests/sqlsrv_native_moodle_database_test.php
lib/filebrowser/tests/file_browser_test.php
lib/filestorage/tests/file_storage_test.php
lib/filestorage/tests/file_system_filedir_test.php
lib/filestorage/tests/file_system_test.php
lib/filestorage/tests/zip_packer_test.php
lib/form/tests/course_test.php
lib/form/tests/dateselector_test.php
lib/form/tests/datetimeselector_test.php
lib/form/tests/duration_test.php
lib/form/tests/external_test.php
lib/form/tests/filetypes_util_test.php
lib/form/tests/privacy_provider_test.php
lib/grade/tests/fixtures/lib.php
lib/grade/tests/grade_item_test.php
lib/moodlelib.php
lib/navigationlib.php
lib/phpunit/classes/advanced_testcase.php
lib/phpunit/classes/arraydataset.php [deleted file]
lib/phpunit/classes/constraint_object_is_equal_with_exceptions.php
lib/phpunit/classes/database_driver_testcase.php
lib/phpunit/classes/hint_resultprinter.php [deleted file]
lib/phpunit/classes/phpunit_dataset.php [new file with mode: 0644]
lib/phpunit/classes/restore_date_testcase.php
lib/phpunit/lib.php
lib/phpunit/tests/advanced_test.php
lib/phpunit/tests/basic_test.php
lib/phpunit/tests/fixtures/sample_dataset.csv
lib/phpunit/tests/fixtures/sample_dataset.txt [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset.xml
lib/phpunit/tests/fixtures/sample_dataset2.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_col_before_row.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_insert.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_many.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_many_with_empty.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_number_of_columns.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_only_colrow.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_repeated.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_row_after_col.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_wrong_attribute.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_wrong_dataset.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_wrong_table.xml [new file with mode: 0644]
lib/phpunit/tests/fixtures/sample_dataset_wrong_value.xml [new file with mode: 0644]
lib/phpunit/tests/phpunit_dataset.test.php [new file with mode: 0644]
lib/templates/loginform.mustache
lib/testing/tests/generator_test.php
lib/tests/accesslib_test.php
lib/tests/admintree_test.php
lib/tests/ajaxlib_test.php
lib/tests/antivirus_test.php
lib/tests/authlib_test.php
lib/tests/blocklib_test.php
lib/tests/calendar_cron_task_test.php
lib/tests/collator_test.php
lib/tests/completionlib_test.php
lib/tests/component_test.php
lib/tests/content_test.php [new file with mode: 0644]
lib/tests/core_media_player_native.php
lib/tests/core_renderer_template_exploit_test.php
lib/tests/csvclass_test.php
lib/tests/customcontext_test.php
lib/tests/event/contentbank_content_created_test.php
lib/tests/event/contentbank_content_deleted_test.php
lib/tests/event/contentbank_content_updated_test.php
lib/tests/event/contentbank_content_uploaded_test.php
lib/tests/event/contentbank_content_viewed_test.php
lib/tests/event_course_module_viewed.php
lib/tests/event_profile_field_test.php
lib/tests/event_test.php
lib/tests/event_user_graded_test.php
lib/tests/events_test.php
lib/tests/exporter_test.php
lib/tests/externallib_test.php
lib/tests/filelib_test.php
lib/tests/filetypes_test.php
lib/tests/filterlib_test.php
lib/tests/gdlib_test.php
lib/tests/grouplib_test.php
lib/tests/h5p_get_content_types_task_test.php
lib/tests/jquery_test.php
lib/tests/lock_test.php
lib/tests/mathslib_test.php
lib/tests/medialib_test.php
lib/tests/messagelib_test.php
lib/tests/minify_test.php
lib/tests/modinfolib_test.php
lib/tests/moodle_page_test.php
lib/tests/moodle_url_test.php
lib/tests/moodlelib_test.php
lib/tests/mustache_template_finder_test.php
lib/tests/mustache_template_source_loader_test.php
lib/tests/myprofilelib_test.php
lib/tests/notification_test.php
lib/tests/outputcomponents_test.php
lib/tests/outputrequirementslib_test.php
lib/tests/persistent_test.php
lib/tests/plugin_manager_test.php
lib/tests/plugininfo/base_test.php
lib/tests/progress_display_test.php
lib/tests/qrcode_test.php
lib/tests/questionlib_test.php
lib/tests/requirejs_test.php
lib/tests/rsslib_test.php
lib/tests/scheduled_task_test.php
lib/tests/session_manager_test.php
lib/tests/session_redis_test.php
lib/tests/setuplib_test.php
lib/tests/statslib_test.php
lib/tests/string_manager_standard_test.php
lib/tests/tablelib_test.php
lib/tests/task_database_logger_test.php
lib/tests/task_logging_test.php
lib/tests/time_splittings_test.php
lib/tests/update_checker_test.php
lib/tests/update_code_manager_test.php
lib/tests/update_validator_test.php
lib/tests/user_test.php
lib/tests/useragent_test.php
lib/upgrade.txt
lib/xapi/tests/external/post_statement_test.php
media/player/html5audio/tests/player_test.php
media/player/html5video/tests/player_test.php
media/player/swf/tests/player_test.php
media/player/videojs/tests/player_test.php
media/player/vimeo/tests/player_test.php
media/player/youtube/tests/player_test.php
message/externallib.php
message/output/airnotifier/tests/externallib_test.php
message/output/airnotifier/tests/privacy_test.php
message/output/email/tests/privacy_test.php
message/output/email/tests/send_email_task_test.php
message/output/jabber/tests/privacy_test.php
message/output/popup/tests/api_test.php
message/output/popup/tests/externallib_test.php
message/tests/api_test.php
message/tests/events_test.php
message/tests/externallib_test.php
message/tests/helper_test.php
message/tests/inbound_test.php
message/tests/messagelib_test.php
message/tests/migrate_message_data_task_test.php
message/tests/privacy_provider_test.php
message/tests/search_received_test.php
message/tests/search_sent_test.php
mnet/service/enrol/tests/privacy_test.php
mnet/tests/events_test.php
mod/assign/feedback/comments/tests/privacy_test.php
mod/assign/feedback/editpdf/tests/editpdf_test.php
mod/assign/feedback/editpdf/tests/privacy_test.php
mod/assign/styles.css
mod/assign/submission/comments/tests/privacy_test.php
mod/assign/tests/base_test.php
mod/assign/tests/externallib_test.php
mod/assign/tests/locallib_test.php
mod/assign/tests/privacy_test.php
mod/book/tests/events_test.php
mod/book/tests/lib_test.php
mod/book/tests/search_test.php
mod/book/tool/exportimscp/tests/events_test.php
mod/book/tool/importhtml/tests/locallib_test.php
mod/book/tool/print/tests/events_test.php
mod/chat/tests/lib_test.php
mod/chat/tests/privacy_test.php
mod/choice/tests/events_test.php
mod/choice/tests/lib_test.php
mod/choice/tests/privacy_provider_test.php
mod/data/tests/events_test.php
mod/data/tests/externallib_test.php
mod/data/tests/import_test.php
mod/data/tests/lib_test.php
mod/data/tests/privacy_provider_test.php
mod/data/tests/search_test.php
mod/feedback/tests/events_test.php
mod/feedback/tests/external_test.php
mod/feedback/tests/privacy_test.php
mod/folder/tests/events_test.php
mod/folder/tests/lib_test.php
mod/folder/tests/search_test.php
mod/forum/tests/behat/discussion_lock.feature
mod/forum/tests/builders_exported_posts_test.php
mod/forum/tests/events_test.php
mod/forum/tests/exporters_discussion_test.php
mod/forum/tests/externallib_test.php
mod/forum/tests/generator_test.php
mod/forum/tests/grades_gradeitems_test.php
mod/forum/tests/lib_test.php
mod/forum/tests/mail_group_test.php
mod/forum/tests/mail_test.php
mod/forum/tests/maildigest_test.php
mod/forum/tests/managers_capability_test.php
mod/forum/tests/privacy_provider_test.php
mod/forum/tests/private_replies_test.php
mod/forum/tests/qanda_test.php
mod/forum/tests/search_test.php
mod/forum/tests/subscriptions_test.php
mod/forum/tests/vaults_discussion_list_test.php
mod/forum/tests/vaults_discussion_test.php
mod/forum/tests/vaults_post_test.php
mod/glossary/tests/events_test.php
mod/glossary/tests/external_test.php
mod/glossary/tests/privacy_provider_test.php
mod/glossary/tests/search_test.php
mod/label/tests/lib_test.php
mod/lesson/tests/events_test.php
mod/lesson/tests/external_test.php
mod/lesson/tests/privacy_test.php
mod/lti/amd/build/tool_card_controller.min.js
mod/lti/amd/build/tool_card_controller.min.js.map
mod/lti/amd/build/tool_configure_controller.min.js
mod/lti/amd/build/tool_configure_controller.min.js.map
mod/lti/amd/src/tool_card_controller.js
mod/lti/amd/src/tool_configure_controller.js
mod/lti/certs.php
mod/lti/classes/local/ltiopenid/jwks_helper.php [new file with mode: 0644]
mod/lti/classes/local/ltiopenid/registration_exception.php [new file with mode: 0644]
mod/lti/classes/local/ltiopenid/registration_helper.php [new file with mode: 0644]
mod/lti/classes/local/ltiservice/service_base.php
mod/lti/lang/en/lti.php
mod/lti/locallib.php
mod/lti/openid-configuration.php [new file with mode: 0644]
mod/lti/openid-registration.php [new file with mode: 0644]
mod/lti/service/basicoutcomes/classes/local/service/basicoutcomes.php
mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php
mod/lti/service/gradebookservices/tests/privacy_provider_test.php
mod/lti/service/gradebookservices/tests/task_cleanup_test.php
mod/lti/service/memberships/classes/local/service/memberships.php
mod/lti/service/memberships/tests/privacy_provider_test.php
mod/lti/service/toolsettings/classes/local/service/toolsettings.php
mod/lti/startltiadvregistration.php [new file with mode: 0644]
mod/lti/templates/cartridge_registration_form.mustache
mod/lti/templates/external_registration.mustache
mod/lti/templates/loader.mustache
mod/lti/templates/tool_configure.mustache
mod/lti/tests/behat/toolconfigure.feature
mod/lti/tests/externallib_test.php
mod/lti/tests/lib_test.php
mod/lti/tests/openidregistration_test.php [new file with mode: 0644]
mod/lti/tests/task_clean_access_tokens_test.php
mod/page/tests/lib_test.php
mod/quiz/accessrule/seb/tests/access_manager_test.php
mod/quiz/accessrule/seb/tests/backup_restore_test.php
mod/quiz/accessrule/seb/tests/event_test.php
mod/quiz/accessrule/seb/tests/link_generator_test.php
mod/quiz/accessrule/seb/tests/quiz_settings_test.php
mod/quiz/accessrule/seb/tests/rule_test.php
mod/quiz/accessrule/seb/tests/template_test.php
mod/quiz/report/overview/tests/report_test.php
mod/quiz/report/responses/tests/responses_from_steps_walkthrough_test.php
mod/quiz/report/statistics/tests/statistics_test.php
mod/quiz/report/statistics/tests/stats_from_steps_walkthrough_test.php
mod/quiz/tests/attempt_walkthrough_from_csv_test.php
mod/quiz/tests/external_test.php
mod/quiz/tests/local_structure_slot_random_test.php
mod/quiz/tests/locallib_test.php
mod/quiz/tests/privacy_provider_test.php
mod/quiz/tests/quiz_question_bank_view_test.php
mod/quiz/tests/repaginate_test.php
mod/quiz/tests/structure_test.php
mod/quiz/tests/tags_test.php
mod/resource/tests/events_test.php
mod/resource/tests/lib_test.php
mod/resource/tests/search_test.php
mod/scorm/report/basic/tests/privacy_test.php
mod/scorm/report/interactions/tests/privacy_test.php
mod/scorm/report/objectives/tests/privacy_test.php
mod/scorm/tests/events_test.php
mod/scorm/tests/externallib_test.php
mod/scorm/tests/lib_test.php
mod/scorm/tests/locallib_test.php
mod/survey/tests/events_test.php
mod/survey/tests/externallib_test.php
mod/survey/tests/lib_test.php
mod/survey/tests/privacy_test.php
mod/url/tests/lib_test.php
mod/wiki/tests/events_test.php
mod/wiki/tests/externallib_test.php
mod/wiki/tests/lib_test.php
mod/wiki/tests/privacy_test.php
mod/wiki/tests/search_test.php
mod/wiki/tests/wikiparser_test.php
mod/workshop/allocation/manual/tests/privacy_provider_test.php
mod/workshop/allocation/random/tests/allocator_test.php
mod/workshop/eval/best/tests/lib_test.php
mod/workshop/form/accumulative/tests/lib_test.php
mod/workshop/form/numerrors/tests/lib_test.php
mod/workshop/form/rubric/tests/lib_test.php
mod/workshop/tests/cron_task_test.php
mod/workshop/tests/events_test.php
mod/workshop/tests/external_test.php
mod/workshop/tests/locallib_test.php
mod/workshop/tests/portfolio_caller_test.php
mod/workshop/tests/privacy_provider_test.php
my/tests/events_test.php
notes/tests/events_test.php
notes/tests/generator_test.php
notes/tests/lib_test.php
phpunit.xml.dist
privacy/classes/tests/provider_testcase.php
privacy/tests/manager_test.php
privacy/tests/provider_test.php
privacy/tests/request_transform_test.php
privacy/tests/writer_test.php
question/behaviour/adaptive/tests/behaviourtype_test.php
question/behaviour/adaptive/tests/mark_display_test.php
question/behaviour/adaptive/tests/walkthrough_test.php
question/behaviour/adaptivenopenalty/tests/walkthrough_test.php
question/behaviour/deferredcbm/tests/behaviourtype_test.php
question/behaviour/deferredcbm/tests/question_cbm_test.php
question/behaviour/deferredcbm/tests/walkthrough_test.php
question/behaviour/deferredfeedback/tests/behaviourtype_test.php
question/behaviour/deferredfeedback/tests/walkthrough_test.php
question/behaviour/immediatecbm/tests/behaviourtype_test.php
question/behaviour/immediatecbm/tests/walkthrough_test.php
question/behaviour/immediatefeedback/tests/behaviourtype_test.php
question/behaviour/immediatefeedback/tests/walkthrough_test.php
question/behaviour/informationitem/tests/behaviourtype_test.php
question/behaviour/interactive/renderer.php
question/behaviour/interactive/tests/behaviourtype_test.php
question/behaviour/interactive/tests/walkthrough_test.php
question/behaviour/interactivecountback/tests/behaviourtype_test.php
question/behaviour/manualgraded/tests/behaviourtype_test.php
question/behaviour/missing/tests/behaviourtype_test.php
question/behaviour/missing/tests/missingbehaviour_test.php
question/engine/tests/helpers.php
question/engine/tests/questionattempt_test.php
question/engine/tests/questionattempt_with_steps_test.php
question/engine/tests/questionattemptiterator_test.php
question/engine/tests/questionattemptstep_test.php
question/engine/tests/questionattemptstepiterator_test.php
question/engine/tests/questionengine_test.php
question/engine/tests/questionusage_autosave_test.php
question/engine/tests/questionutils_test.php
question/engine/tests/unitofwork_test.php
question/engine/upgrade/tests/helper.php
question/format/aiken/tests/aikenformat_test.php
question/format/multianswer/tests/multianswerformat_test.php
question/format/xml/tests/qformat_xml_import_export_test.php
question/tests/bank_view_test.php
question/tests/category_class_test.php
question/tests/events_test.php
question/tests/externallib_test.php
question/tests/privacy_provider_test.php
question/tests/question_bank_column_test.php
question/type/calculated/tests/formula_validation_test.php
question/type/calculated/tests/questiontype_test.php
question/type/calculated/tests/variablesubstituter_test.php
question/type/calculatedsimple/tests/questiontype_test.php
question/type/ddimageortext/tests/questiontype_test.php
question/type/ddmarker/tests/questiontype_test.php
question/type/ddwtos/tests/questiontype_test.php
question/type/description/tests/questiontype_test.php
question/type/essay/tests/questiontype_test.php
question/type/essay/tests/walkthrough_test.php
question/type/gapselect/tests/questiontype_test.php
question/type/match/tests/questiontype_test.php
question/type/missingtype/tests/missingtype_test.php
question/type/multianswer/tests/questiontype_test.php
question/type/multichoice/tests/question_multi_test.php
question/type/multichoice/tests/question_single_test.php
question/type/multichoice/tests/questiontype_test.php
question/type/numerical/tests/answerprocessor_test.php
question/type/numerical/tests/questiontype_test.php
question/type/random/tests/questiontype_test.php
question/type/shortanswer/tests/questiontype_test.php
question/type/tests/question_first_matching_answer_grading_strategy_test.php
question/type/truefalse/tests/questiontype_test.php
rating/tests/externallib_test.php
rating/tests/rating_test.php
report/completion/tests/events_test.php
report/log/tests/events_test.php
report/log/tests/lib_test.php
report/loglive/tests/events_test.php
report/outline/tests/lib_test.php
report/questioninstances/tests/events_test.php
report/stats/tests/events_test.php
report/stats/tests/lib_test.php
report/usersessions/tests/lib_test.php
repository/contentbank/tests/browser_test.php
repository/contentbank/tests/search_test.php
repository/flickr/tests/privacy_test.php
repository/nextcloud/tests/access_controlled_link_manager_test.php
repository/nextcloud/tests/lib_test.php
repository/nextcloud/tests/ocs_test.php
repository/onedrive/tests/privacy_test.php
repository/recent/tests/lib_test.php
repository/tests/privacy_test.php
repository/tests/repositorylib_test.php
rss/tests/privacy_test.php
search/engine/simpledb/tests/engine_test.php
search/engine/simpledb/tests/privacy_test.php
search/engine/solr/tests/engine_test.php
search/tests/base_activity_test.php
search/tests/base_test.php
search/tests/document_test.php
search/tests/engine_test.php
search/tests/external_test.php
search/tests/generator/lib.php
search/tests/manager_test.php
tag/tests/events_test.php
tag/tests/taglib_test.php
theme/boost/scss/moodle/calendar.scss
theme/boost/scss/moodle/forms.scss
theme/boost/scss/moodle/question.scss
theme/boost/scss/preset/default.scss
theme/boost/style/moodle.css
theme/classic/scss/preset/default.scss
theme/classic/style/moodle.css
user/profile/field/checkbox/tests/privacy_test.php
user/profile/field/datetime/tests/privacy_test.php
user/profile/field/menu/tests/privacy_test.php
user/profile/field/text/tests/privacy_test.php
user/profile/field/textarea/tests/privacy_test.php
user/tests/externallib_test.php
user/tests/myprofile_test.php
user/tests/search_test.php
user/tests/userlib_test.php
user/tests/userroleseditable_test.php
version.php
webservice/tests/events_test.php
webservice/tests/externallib_test.php
webservice/tests/lib_test.php
webservice/tests/privacy_test.php
webservice/xmlrpc/tests/lib_test.php
webservice/xmlrpc/tests/locallib_test.php
webservice/xmlrpc/tests/xmlrpc_server_test.php

index 9d02c9b..41e19ac 100644 (file)
@@ -33,6 +33,7 @@ CVS
 /.project
 /.buildpath
 /.cache
+.phpunit.result.cache
 phpunit.xml
 # Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
 composer.phar
index fbf8ac4..f344cfe 100644 (file)
@@ -43,7 +43,7 @@ class testoutgoingmailconf_form extends \moodleform {
         $mform = $this->_form;
 
         // Recipient.
-        $options = ['maxlength' => '100', 'size' => '25'];
+        $options = ['maxlength' => '100', 'size' => '25', 'autocomplete' => 'email'];
         $mform->addElement('text', 'recipient', get_string('testoutgoingmailconf_toemail', 'admin'), $options);
         $mform->setType('recipient', PARAM_EMAIL);
         $mform->addRule('recipient', get_string('required'), 'required');
index e5a6edb..3352f1e 100644 (file)
@@ -178,6 +178,7 @@ class filesize extends \admin_setting {
             'id' => $this->get_id(),
             'name' => $this->get_full_name(),
             'value' => $data['v'],
+            'readonly' => $this->is_readonly(),
             'options' => array_map(function($unit, $title) use ($data, $defaultunit) {
                 return [
                     'value' => $unit,
index 258b5a7..82203c1 100644 (file)
@@ -536,7 +536,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user1->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist2->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist2->get_userids());
 
         // The user list for coursecontext1 should user1, user2 and admin (role creator).
         $userlist3 = new \core_privacy\local\request\userlist($coursecontext1, $component);
@@ -547,7 +547,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user2->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist3->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist3->get_userids());
 
         // The user list for coursecatcontext should user2 and admin (role creator).
         $userlist4 = new \core_privacy\local\request\userlist($coursecatcontext, $component);
@@ -557,7 +557,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user2->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist4->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist4->get_userids());
 
         // The user list for systemcontext should user1 and admin (role creator).
         $userlist6 = new \core_privacy\local\request\userlist($systemcontext, $component);
@@ -567,7 +567,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user1->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist6->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist6->get_userids());
 
         // The user list for cmcontext should user1, user2 and admin (role creator).
         $userlist7 = new \core_privacy\local\request\userlist($cmcontext, $component);
@@ -578,7 +578,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user2->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist7->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist7->get_userids());
 
         // The user list for blockcontext should user1 and admin (role creator).
         $userlist8 = new \core_privacy\local\request\userlist($blockcontext, $component);
@@ -588,7 +588,7 @@ class core_role_privacy_testcase extends provider_testcase {
             $user1->id,
             $admin->id
         ];
-        $this->assertEquals($expected, $userlist8->get_userids(), '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $userlist8->get_userids());
     }
 
     /**
@@ -744,4 +744,4 @@ class core_role_privacy_testcase extends provider_testcase {
         }
         return $rolesnames;
     }
-}
\ No newline at end of file
+}
index a722244..30b6a22 100644 (file)
@@ -131,15 +131,10 @@ if ($hassiteconfig && \core_analytics\manager::is_analytics_enabled()) {
             $timesplittingdefaults, $timesplittingoptions)
         );
 
-        // Predictions processor output dir.
-        $defaultmodeloutputdir = rtrim($CFG->dataroot, '/') . DIRECTORY_SEPARATOR . 'models';
-        if (empty(get_config('analytics', 'modeloutputdir')) && !file_exists($defaultmodeloutputdir) &&
-                is_writable($defaultmodeloutputdir)) {
-            // Automatically create the dir for them so users don't see the invalid value red cross.
-            mkdir($defaultmodeloutputdir, $CFG->directorypermissions, true);
-        }
+        // Predictions processor output dir - specify default in setting description (used if left blank).
+        $defaultmodeloutputdir = \core_analytics\model::default_output_dir();
         $settings->add(new admin_setting_configdirectory('analytics/modeloutputdir', new lang_string('modeloutputdir', 'analytics'),
-            new lang_string('modeloutputdirinfo', 'analytics'), $defaultmodeloutputdir));
+            new lang_string('modeloutputdirwithdefaultinfo', 'analytics', $defaultmodeloutputdir), ''));
 
         // Disable web interface evaluation and get predictions.
         $settings->add(new admin_setting_configcheckbox('analytics/onlycli', new lang_string('onlycli', 'analytics'),
index 6b53eb0..c0da1aa 100644 (file)
@@ -22,6 +22,8 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
+use core_admin\local\settings\filesize;
+
 $capabilities = array(
     'moodle/backup:backupcourse',
     'moodle/category:manage',
@@ -75,6 +77,17 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
     $temp->add(new admin_setting_configselect('moodlecourse/visible', new lang_string('visible'), new lang_string('visible_help'),
         1, $choices));
 
+    // Enable/disable download course content.
+    $choices = [
+        DOWNLOAD_COURSE_CONTENT_DISABLED => new lang_string('no'),
+        DOWNLOAD_COURSE_CONTENT_ENABLED => new lang_string('yes'),
+    ];
+    $downloadcontentsitedefault = new admin_setting_configselect('moodlecourse/downloadcontentsitedefault',
+            new lang_string('enabledownloadcoursecontent', 'course'),
+            new lang_string('downloadcoursecontent_help', 'course'), 0, $choices);
+    $downloadcontentsitedefault->add_dependent_on('downloadcoursecontentallowed');
+    $temp->add($downloadcontentsitedefault);
+
     // Course format.
     $temp->add(new admin_setting_heading('courseformathdr', new lang_string('type_format', 'plugin'), ''));
 
@@ -161,6 +174,21 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
 
     $ADMIN->add('courses', $temp);
 
+    // Download course content.
+    $downloadcoursedefaulturl = new moodle_url('/admin/settings.php', ['section' => 'coursesettings']);
+    $temp = new admin_settingpage('downloadcoursecontent', new lang_string('downloadcoursecontent', 'course'));
+    $temp->add(new admin_setting_configcheckbox('downloadcoursecontentallowed',
+            new lang_string('downloadcoursecontentallowed', 'admin'),
+            new lang_string('downloadcoursecontentallowed_desc', 'admin', $downloadcoursedefaulturl->out()), 0));
+
+    // 50MB default maximum size per file when downloading course content.
+    $defaultmaxdownloadsize = 50 * filesize::UNIT_MB;
+    $temp->add(new filesize('maxsizeperdownloadcoursefile', new lang_string('maxsizeperdownloadcoursefile', 'admin'),
+            new lang_string('maxsizeperdownloadcoursefile_desc', 'admin'), $defaultmaxdownloadsize, filesize::UNIT_MB));
+    $temp->hide_if('maxsizeperdownloadcoursefile', 'downloadcoursecontentallowed');
+
+    $ADMIN->add('courses', $temp);
+
     // "courserequests" settingpage.
     $temp = new admin_settingpage('courserequest', new lang_string('courserequest'));
     $temp->add(new admin_setting_configcheckbox('enablecourserequests',
index cb586b4..11541bb 100644 (file)
@@ -455,6 +455,15 @@ if ($hassiteconfig) {
         new lang_string('divertallemailsexcept_desc', 'admin'),
         '', PARAM_RAW, '50', '4'));
 
+    $noreplyaddress = isset($CFG->noreplyaddress) ? $CFG->noreplyaddress : 'noreply@example.com';
+    $dkimdomain = substr(strrchr($noreplyaddress, "@"), 1);
+    $dkimselector = empty($CFG->emaildkimselector) ? '[selector]' : $CFG->emaildkimselector;
+    $pempath = "\$CFG->dataroot/dkim/{$dkimdomain}/{$dkimselector}.private";
+    $temp->add(new admin_setting_heading('emaildkim', new lang_string('emaildkim', 'admin'),
+        new lang_string('emaildkiminfo', 'admin', ['path' => $pempath, 'docs' => \get_docs_url('Mail_configuration#DKIM')])));
+    $temp->add(new admin_setting_configtext('emaildkimselector', new lang_string('emaildkimselector', 'admin'),
+        new lang_string('configemaildkimselector', 'admin'), '', PARAM_FILE));
+
     $url = new moodle_url('/admin/testoutgoingmailconf.php');
     $link = html_writer::link($url, get_string('testoutgoingmailconf', 'admin'));
     $temp->add(new admin_setting_heading('testoutgoinmailc', new lang_string('testoutgoingmailconf', 'admin'),
index f41e5a2..48e0471 100644 (file)
@@ -25,6 +25,7 @@
     * value - yes value
     * id - element id
     * checked - boole
+    * readonly - bool
 
     Example context (json):
     {
         "no": "False",
         "value": "True",
         "id": "test0",
-        "checked": "checked"
+        "checked": "checked",
+        "readonly": false
     }
 }}
 <div class="form-checkbox defaultsnext">
     <input type="hidden" name="{{name}}" value="{{no}}">
-    <input type="checkbox" name="{{name}}" value="{{value}}" id="{{id}}" {{#checked}}checked{{/checked}}>
+    <input {{#readonly}}disabled{{/readonly}} type="checkbox" name="{{name}}" value="{{value}}" id="{{id}}" {{#checked}}checked{{/checked}}>
 </div>
index 3de5aac..50b7da1 100644 (file)
@@ -25,6 +25,7 @@
     * id - element id
     * value - element value
     * haspreviewconfig - show preview of selected color
+    * readonly - bool
 
     Example context (json):
     {
@@ -32,6 +33,7 @@
         "name": "name0",
         "id": "id0",
         "value": "#555655",
+        "readonly": false,
         "haspreviewconfig": false
     }
 }}
@@ -44,7 +46,7 @@
             {{>core/pix_icon}}
         {{/icon}}
     </div>
-    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr">
+    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
     {{#haspreviewconfig}}
         <input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
     {{/haspreviewconfig}}
index 1804787..cfe8a7d 100644 (file)
@@ -33,7 +33,7 @@
         "name": "test",
         "value": "/my-super-secret-path/",
         "id": "test0",
-        "readonly": true,
+        "readonly": false,
         "showvalidity": true,
         "valid": false
     }
index d20dabc..1a880c1 100644 (file)
@@ -23,6 +23,7 @@
     * name - form element name
     * options - list of options for units containing name, value, selected
     * value - yes
+    * readonly - bool
     * id - element id
 
     Example context (json):
@@ -30,6 +31,7 @@
         "name": "test",
         "value": "5",
         "id": "test0",
+        "readonly": false,
         "options": [ { "name": "Minutes", "value": "mins", "selected": true } ]
     }
 }}
@@ -38,9 +40,9 @@
 }}
 <div class="form-duration defaultsnext">
     <div class="form-inline">
-        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr">
+        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
         <label class="sr-only" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
-        <select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select">
+        <select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select" {{#readonly}}disabled{{/readonly}}>
             {{#options}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/options}}
index 72187f2..773b07d 100644 (file)
@@ -33,7 +33,7 @@
         "name": "test",
         "value": "/usr/bin/cowsay",
         "id": "test0",
-        "readonly": true,
+        "readonly": false,
         "showvalidity": true,
         "valid": false
     }
index 1f0b5d5..15a45ce 100644 (file)
@@ -26,6 +26,7 @@
     * readonly - Make the field readonly
     * value - value
     * showvalidity - Show a green check if the path is readable
+    * readonly - bool
     * valid - True if the path is readable
 
     Example context (json):
@@ -33,8 +34,9 @@
         "name": "test",
         "value": "/my-super-secret-path/file",
         "id": "test0",
-        "readonly": true,
+        "readonly": false,
         "showvalidity": true,
+        "readonly": false,
         "valid": false
     }
 }}
index 4716c6e..355cc6d 100644 (file)
     * options - list of options for units containing name, value, selected
     * value - yes
     * id - element id
+    * readonly - bool
 
     Example context (json):
     {
         "name": "test",
         "value": "5",
         "id": "test0",
+        "readonly": false,
         "options": [ { "name": "KB", "value": "1024", "selected": true } ]
     }
 }}
@@ -38,9 +40,9 @@
 }}
 <div class="form-filesize defaultsnext">
     <div class="form-inline">
-        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr">
+        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr" {{#readonly}}disabled{{/readonly}}>
         <label class="sr-only" for="{{id}}u">{{#str}}filesizeunits, admin{{/str}}</label>
-        <select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select">
+        <select id="{{id}}u" name="{{name}}[u]" class="form-control custom-select" {{#readonly}}disabled{{/readonly}}>
             {{#options}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/options}}
index 49eb55c..c19b1fd 100644 (file)
     * id - element id
     * size - element size
     * options - list of options containing name, value, selected
+    * readonly - bool
 
     Example context (json):
     {
         "name": "test",
         "id": "test0",
+        "readonly": false,
         "size": "3",
         "options": [ { "name": "Option 1", "value": "V", "selected": true },
                      { "name": "Option 2", "value": "V", "selected": true } ]
@@ -39,7 +41,7 @@
 }}
 <div class="form-select">
     <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
+    <select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index 20d66e1..a1cbc9d 100644 (file)
     * size - element size
     * options - list of options not grouped
     * optgroups - list of options grouped containing the group label and for each option: name, value, selected
+    * readonly - bool
 
     Example context (json):
     {
         "name": "test",
         "id": "test0",
+        "readonly": false,
         "size": "3",
         "options": [
             { "name": "Option 1", "value": "V", "selected": false },
@@ -58,7 +60,7 @@
 }}
 <div class="form-select">
     <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
+    <select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
     {{#options}}
         <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
     {{/options}}
index 7092e82..84a27a6 100644 (file)
@@ -24,7 +24,7 @@
     * size - form element size
     * value - form element value
     * id - element id
-    * forced - has value been defined in config.php
+    * readonly - has value been defined in config.php
 
     Example context (json):
     {
         "id": "test0",
         "size": "8",
         "value": "secret",
-        "forced": false
+        "readonly": false
     }
 }}
-{{#forced}}
+{{#readonly}}
     <div class="form-password">
         <input type="text"
                name = "{{ name }}"
@@ -46,8 +46,8 @@
                disabled
         >
     </div>
-{{/forced}}
-{{^forced}}
+{{/readonly}}
+{{^readonly}}
 <div class="form-password">
     <span data-passwordunmask="wrapper" data-passwordunmaskid="{{ id }}">
         <span data-passwordunmask="editor">
@@ -76,4 +76,4 @@ require(['core_form/passwordunmask'], function(PasswordUnmask) {
     new PasswordUnmask("{{ id }}");
 });
 {{/js}}
-{{/forced}}
+{{/readonly}}
index 9b6c6e1..eb18b4b 100644 (file)
     * name - form element name
     * id - element id
     * options - list of options containing name, value, selected
+    * readonly - bool
 
     Example context (json):
     {
         "name": "test",
         "id": "test0",
+        "readonly": false,
         "options": [
             { "name": "Option 1", "value": "V", "selected": true },
             { "name": "Option 2", "value": "V", "selected": true }
@@ -38,7 +40,7 @@
     Setting configselect.
 }}
 <div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}" class="custom-select">
+    <select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}" class="custom-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index 95f818b..862ac61 100644 (file)
@@ -22,6 +22,7 @@
     Context variables required for this template:
     * name - form element name
     * id - element id
+    * readonly - bool
     * options - list of options (not grouped)
     * optgroups - list of options grouped containing the group label and for each option: name, value, selected
 
@@ -29,6 +30,7 @@
     {
         "name": "test",
         "id": "test0",
+        "readonly": false,
         "options": [
             { "name": "Option 1", "value": "V", "selected": false },
             { "name": "Option 2", "value": "V", "selected": false }
@@ -55,7 +57,7 @@
     Setting configselect with optgroup support.
 }}
 <div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}" class="custom-select">
+    <select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}" class="custom-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index a31f73a..1238c8e 100644 (file)
@@ -26,6 +26,7 @@
     * size - element size
     * forceltr - always display as ltr
     * attributes - list of additional attributes containing name, value
+    * readonly - bool
 
     Example context (json):
     {
@@ -34,6 +35,7 @@
         "value": "A tall, dark stranger will have more fun than you.",
         "size": "21",
         "forceltr": false,
+        "readonly": false,
         "attributes": [ { "name": "readonly", "value": "readonly" } ]
     }
 }}
@@ -41,5 +43,5 @@
     Setting configtext.
 }}
 <div class="form-text defaultsnext">
-    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">
+    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control {{#forceltr}}text-ltr{{/forceltr}}" {{#readonly}}disabled{{/readonly}}>
 </div>
index 002b0cd..c877d94 100644 (file)
@@ -33,6 +33,7 @@
         "cols": "30",
         "rows": "3",
         "value": "Excellent day for putting Slinkies on an escalator.",
+        "readonly": false,
         "id": "test0"
     }
 }}
@@ -40,5 +41,5 @@
     Setting configtextarea.
 }}
 <div class="form-textarea">
-    <textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
+    <textarea {{#readonly}}disabled{{/readonly}} rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
 </div>
index 90d37b3..af4435a 100644 (file)
     * id - element id
     * hours - list of valid hour options containing name, value, selected
     * minutes - list of valid minute options containing name, value, selected
+    * readonly - bool
 
     Example context (json):
     {
         "name": "test",
         "id": "test0",
+        "readonly": false,
         "minutes": [
             { "name": "00", "value": "0", "selected": true },
             { "name": "01", "value": "1", "selected": false }
 <div class="form-time defaultsnext">
     <div class="form-inline text-ltr">
         <label class="sr-only" for="{{id}}h">{{#str}}hours{{/str}}</label>
-        <select id="{{id}}h" name="{{name}}[h]" class="custom-select">
+        <select id="{{id}}h" name="{{name}}[h]" class="custom-select" {{#readonly}}disabled{{/readonly}}>
             {{#hours}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/hours}}
         </select>:
         <label class="sr-only" for="{{id}}m">{{#str}}minutes{{/str}}</label>
-        <select id="{{id}}m" name="{{name}}[m]" class="custom-select">
+        <select id="{{id}}m" name="{{name}}[m]" class="custom-select" {{#readonly}}disabled{{/readonly}}>
             {{#minutes}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/minutes}}
diff --git a/admin/tests/behat/language_settings.feature b/admin/tests/behat/language_settings.feature
new file mode 100644 (file)
index 0000000..6d00ebe
--- /dev/null
@@ -0,0 +1,34 @@
+@core @core_admin
+Feature: Configure language settings for the site
+  In order to configure language settings for the site
+  As an admin
+  I want to set language settings relevant to my site users
+
+  Scenario: Set languages on language menu
+    Given I log in as "admin"
+    And I navigate to "Language > Language settings" in site administration
+    When I set the field "Languages on language menu" to "en"
+    And I press "Save changes"
+    Then I should not see "Invalid language code"
+
+  Scenario: Reset languages on language menu
+    Given I log in as "admin"
+    And I navigate to "Language > Language settings" in site administration
+    When I set the field "Languages on language menu" to ""
+    And I press "Save changes"
+    Then I should not see "Invalid language code"
+
+  Scenario Outline: Set languages on language menu with invalid language
+    Given I log in as "admin"
+    And I navigate to "Language > Language settings" in site administration
+    When I set the field "Languages on language menu" to "<fieldvalue>"
+    And I press "Save changes"
+    Then I should see "Invalid language code: <invalidlang>"
+    Examples:
+      | fieldvalue | invalidlang |
+      | xx         | xx          |
+      | xx\|Bad    | xx          |
+      | en,qq      | qq          |
+      | en,qq\|Bad | qq          |
+      | en$$       | en$$        |
+      | en$$\|Bad  | en$$        |
index ff26c64..597dda7 100644 (file)
@@ -66,8 +66,6 @@ class tool_analytics_external_testcase extends externallib_advanced_testcase {
 
     /**
      * test_potential_contexts description
-     *
-     * @expectedException required_capability_exception
      */
     public function test_potential_contexts_no_manager() {
         $this->resetAfterTest();
@@ -75,6 +73,7 @@ class tool_analytics_external_testcase extends externallib_advanced_testcase {
         $user = $this->getDataGenerator()->create_user();
         $this->setUser($user);
 
+        $this->expectException(required_capability_exception::class);
         $this->assertCount(2, \tool_analytics\external::potential_contexts());
     }
 }
index 98ccd03..71b4b94 100644 (file)
@@ -87,7 +87,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
     /**
      * Setup test.
      */
-    public function setup() {
+    public function setUp(): void {
         global $CFG;
 
         $this->resetAfterTest();
@@ -165,7 +165,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -219,7 +219,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -264,7 +264,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -295,7 +295,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -324,7 +324,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -368,7 +368,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -399,7 +399,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -428,7 +428,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -532,7 +532,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -611,7 +611,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
         // Check contexts.
@@ -646,7 +646,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -662,7 +662,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -678,7 +678,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
 
@@ -693,7 +693,7 @@ class tool_behat_manager_util_testcase extends advanced_testcase {
             $this->assertCount(count($paths), $suites[$themename]['paths']);
 
             foreach ($paths as $key => $feature) {
-                $this->assertContains($feature, $suites[$themename]['paths'][$key]);
+                $this->assertStringContainsString($feature, $suites[$themename]['paths'][$key]);
             }
         }
     }
index 30942ca..1e3e8d5 100644 (file)
@@ -36,7 +36,7 @@ class tool_capability_events_testcase extends advanced_testcase {
     /**
      * Setup testcase.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->setAdminUser();
         $this->resetAfterTest();
     }
index 2d99e5c..0464370 100644 (file)
@@ -49,7 +49,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
     /**
      * Setup function- we will create a course and add an assign instance to it.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         $this->resetAfterTest(true);
 
         // Create some users.
@@ -60,9 +60,6 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
         cohort_add_member($this->cohort->id, $this->userassignover->id);
     }
 
-    /**
-     * @expectedException required_capability_exception
-     */
     public function test_create_cohort_role_assignment_without_permission() {
         $this->setUser($this->userassignto);
         $params = (object) array(
@@ -70,12 +67,10 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
             'roleid' => $this->roleid,
             'cohortid' => $this->cohort->id
         );
+        $this->expectException(required_capability_exception::class);
         api::create_cohort_role_assignment($params);
     }
 
-    /**
-     * @expectedException core_competency\invalid_persistent_exception
-     */
     public function test_create_cohort_role_assignment_with_invalid_data() {
         $this->setAdminUser();
         $params = (object) array(
@@ -83,6 +78,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
             'roleid' => -8,
             'cohortid' => $this->cohort->id
         );
+        $this->expectException(\core_competency\invalid_persistent_exception::class);
         api::create_cohort_role_assignment($params);
     }
 
@@ -100,9 +96,6 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
         $this->assertEquals($result->get('cohortid'), $this->cohort->id);
     }
 
-    /**
-     * @expectedException required_capability_exception
-     */
     public function test_delete_cohort_role_assignment_without_permission() {
         $this->setAdminUser();
         $params = (object) array(
@@ -112,12 +105,10 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
         );
         $result = api::create_cohort_role_assignment($params);
         $this->setUser($this->userassignto);
+        $this->expectException(required_capability_exception::class);
         api::delete_cohort_role_assignment($result->get('id'));
     }
 
-    /**
-     * @expectedException dml_missing_record_exception
-     */
     public function test_delete_cohort_role_assignment_with_invalid_data() {
         $this->setAdminUser();
         $params = (object) array(
@@ -126,6 +117,7 @@ class tool_cohortroles_api_testcase extends advanced_testcase {
             'cohortid' => $this->cohort->id
         );
         $result = api::create_cohort_role_assignment($params);
+        $this->expectException(dml_missing_record_exception::class);
         api::delete_cohort_role_assignment($result->get('id') + 1);
     }
 
index 6399314..e5c4b9c 100644 (file)
@@ -43,7 +43,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
     /**
      * Overriding setUp() function to always reset after tests.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
     }
 
@@ -87,7 +87,7 @@ class tool_cohortroles_privacy_testcase extends \core_privacy\tests\provider_tes
             CONTEXT_COURSECAT
         ];
         // Test the User's contexts equal the system and course category context.
-        $this->assertEquals($expected, $contextlevels, '', 0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $contextlevels);
     }
 
     /**
index 7bf94cc..4cb3450 100644 (file)
@@ -997,8 +997,8 @@ class tool_dataprivacy_api_testcase extends advanced_testcase {
         $this->assertEquals($subject, $message->subject);
         $this->assertEquals('tool_dataprivacy', $message->component);
         $this->assertEquals('contactdataprotectionofficer', $message->eventtype);
-        $this->assertContains(fullname($dpo), $message->fullmessage);
-        $this->assertContains(fullname($user1), $message->fullmessage);
+        $this->assertStringContainsString(fullname($dpo), $message->fullmessage);
+        $this->assertStringContainsString(fullname($user1), $message->fullmessage);
     }
 
     /**
index eec0bd5..32c4f56 100644 (file)
@@ -44,7 +44,7 @@ class tool_dataprivacy_expired_data_requests_testcase extends data_privacy_testc
     /**
      * Test tearDown.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         \core_privacy\local\request\writer::reset();
     }
 
index 1c47153..a68bd88 100644 (file)
@@ -63,7 +63,7 @@ class tool_dataprivacy_manager_observer_testcase extends data_privacy_testcase {
             return $message->useridto;
         }, $messages);
 
-        $this->assertEquals(array_keys($dpos), $messageusers, '', 0.0, 0, true);
+        $this->assertEqualsCanonicalizing(array_keys($dpos), $messageusers);
     }
 
     /**
index e671fa7..cfbaac3 100644 (file)
@@ -142,7 +142,7 @@ class tool_dataprivacy_privacy_provider_testcase extends provider_testcase {
         $this->assertEquals($strs->statusrejected, $data[1]->status);
         $this->assertEquals($strs->creationmanual, $data[1]->creationmethod);
         $this->assertEmpty($data[1]->comments);
-        $this->assertContains('Nope', $data[1]->dpocomment);
+        $this->assertStringContainsString('Nope', $data[1]->dpocomment);
         $this->assertNotEmpty($data[1]->timecreated);
     }
 
@@ -184,4 +184,4 @@ class tool_dataprivacy_privacy_provider_testcase extends provider_testcase {
 
         $this->assertEquals(6, $preferences[helper::PREF_REQUEST_PERPAGE]->value);
     }
-}
\ No newline at end of file
+}
index 0dc614a..8ab8919 100644 (file)
@@ -39,7 +39,7 @@ class tool_dataprivacy_task_testcase extends data_privacy_testcase {
     /**
      * Test tearDown.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         \core_privacy\local\request\writer::reset();
     }
 
index e3599c6..fb60090 100644 (file)
@@ -155,7 +155,7 @@ class httpsreplace_test extends \advanced_testcase {
         $finder->upgrade_http_links();
 
         $summary = $DB->get_field('course', 'summary', ['id' => $course->id]);
-        $this->assertContains($expectedcontent, $summary);
+        $this->assertStringContainsString($expectedcontent, $summary);
     }
 
     /**
@@ -253,10 +253,10 @@ class httpsreplace_test extends \advanced_testcase {
         $this->assertCount(0, $results);
 
         $summary = $DB->get_field('course', 'summary', ['id' => $course->id]);
-        $this->assertContains('http://intentionally.unavailable/page.php', $summary);
-        $this->assertContains('http://other.unavailable/page.php', $summary);
-        $this->assertNotContains('https://intentionally.unavailable', $summary);
-        $this->assertNotContains('https://other.unavailable', $summary);
+        $this->assertStringContainsString('http://intentionally.unavailable/page.php', $summary);
+        $this->assertStringContainsString('http://other.unavailable/page.php', $summary);
+        $this->assertStringNotContainsString('https://intentionally.unavailable', $summary);
+        $this->assertStringNotContainsString('https://other.unavailable', $summary);
     }
 
     /**
@@ -281,7 +281,7 @@ class httpsreplace_test extends \advanced_testcase {
 
         $finder->upgrade_http_links();
         $summary = $DB->get_field('course', 'summary', ['id' => $course->id]);
-        $this->assertContains($CFG->wwwroot, $summary);
+        $this->assertStringContainsString($CFG->wwwroot, $summary);
     }
 
     /**
@@ -298,10 +298,10 @@ class httpsreplace_test extends \advanced_testcase {
         $output = ob_get_contents();
         ob_end_clean();
         $this->assertTrue($results);
-        $this->assertNotContains('https://somesite', $output);
+        $this->assertStringNotContainsString('https://somesite', $output);
         $testconf = get_config('core', 'test_upgrade_http_links');
-        $this->assertContains('http://somesite', $testconf);
-        $this->assertNotContains('https://somesite', $testconf);
+        $this->assertStringContainsString('http://somesite', $testconf);
+        $this->assertStringNotContainsString('https://somesite', $testconf);
     }
 
     /**
@@ -331,8 +331,8 @@ class httpsreplace_test extends \advanced_testcase {
         $finder->upgrade_http_links();
 
         $summary = $DB->get_field('course', 'summary', ['id' => $course->id]);
-        $this->assertContains('https://secure.example.com', $summary);
-        $this->assertNotContains('http://example.com', $summary);
+        $this->assertStringContainsString('https://secure.example.com', $summary);
+        $this->assertStringNotContainsString('http://example.com', $summary);
         $this->assertEquals('<script src="https://secure.example.com/test.js">' .
             '<img src="https://secure.example.com/someimage.png">', $summary);
     }
@@ -401,7 +401,7 @@ class httpsreplace_test extends \advanced_testcase {
         $finder->upgrade_http_links();
 
         $record = $DB->get_record('reserved_words_temp', []);
-        $this->assertContains($expectedcontent, $record->where);
+        $this->assertStringContainsString($expectedcontent, $record->where);
 
         $dbman->drop_table($table);
     }
index 55a0608..cff9578 100644 (file)
@@ -44,7 +44,7 @@ class tool_installaddon_installer_testcase extends advanced_testcase {
         $this->assertEquals(1, preg_match('~^site=(.+)$~', $query, $matches));
         $site = rawurldecode($matches[1]);
         $site = json_decode(base64_decode($site), true);
-        $this->assertInternalType('array', $site);
+        $this->assertIsArray($site);
         $this->assertEquals(3, count($site));
         $this->assertSame('Nasty site', $site['fullname']);
         $this->assertSame('file:///etc/passwd', $site['url']);
index d2164cf..84a9488 100644 (file)
@@ -36,7 +36,7 @@ class tool_langimport_events_testcase extends advanced_testcase {
     /**
      * Setup testcase.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->setAdminUser();
         $this->resetAfterTest();
     }
@@ -56,12 +56,10 @@ class tool_langimport_events_testcase extends advanced_testcase {
         $this->assertEquals(context_system::instance(), $event->get_context());
     }
 
-    /**
-     * @expectedException        coding_exception
-     * @expectedExceptionMessage The 'langcode' value must be set to a valid language code
-     */
     public function test_langpack_updated_validation() {
 
+        $this->expectException('coding_exception');
+        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
         \tool_langimport\event\langpack_updated::event_with_langcode('broken langcode');
     }
 
@@ -78,12 +76,10 @@ class tool_langimport_events_testcase extends advanced_testcase {
         $this->assertEquals(context_system::instance(), $event->get_context());
     }
 
-    /**
-     * @expectedException        coding_exception
-     * @expectedExceptionMessage The 'langcode' value must be set to a valid language code
-     */
     public function test_langpack_installed_validation() {
 
+        $this->expectException('coding_exception');
+        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
         \tool_langimport\event\langpack_imported::event_with_langcode('broken langcode');
     }
 
@@ -100,12 +96,10 @@ class tool_langimport_events_testcase extends advanced_testcase {
         $this->assertEquals(context_system::instance(), $event->get_context());
     }
 
-    /**
-     * @expectedException        coding_exception
-     * @expectedExceptionMessage The 'langcode' value must be set to a valid language code
-     */
     public function test_langpack_removed_validation() {
 
+        $this->expectException('coding_exception');
+        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
         \tool_langimport\event\langpack_removed::event_with_langcode('broken langcode');
     }
 }
index 085ce1b..86b8b37 100644 (file)
@@ -50,7 +50,7 @@ require_once(__DIR__ . '/fixtures/event.php');
  */
 class logstore_database_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         global $CFG;
         $this->resetAfterTest();
         $this->preventResetByRollback(); // Logging waits till the transaction gets committed.
index d6d2a6c..ad0e992 100644 (file)
@@ -48,7 +48,7 @@ require_once(__DIR__ . '/fixtures/event.php');
  */
 class logstore_legacy_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
     }
 
index 1e23599..d324d79 100644 (file)
@@ -47,7 +47,7 @@ require_once(__DIR__ . '/fixtures/event.php');
  */
 class logstore_standard_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
         $this->preventResetByRollback(); // Logging waits till the transaction gets committed.
     }
index 1492718..aeb15c6 100644 (file)
@@ -540,7 +540,7 @@ class logstore_standard_store_testcase extends advanced_testcase {
     /**
      * Reset any garbage collector changes to the previous state at the end of the test.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         if ($this->wedisabledgc) {
             gc_enable();
         }
index e9e3164..1cd1a92 100644 (file)
@@ -33,7 +33,7 @@ class tool_log_manager_testcase extends advanced_testcase {
         $this->assertInstanceOf('core\log\manager', $manager);
 
         $stores = $manager->get_readers();
-        $this->assertInternalType('array', $stores);
+        $this->assertIsArray($stores);
         $this->assertCount(0, $stores);
 
         $this->assertFileExists("$CFG->dirroot/$CFG->admin/tool/log/store/standard/version.php");
@@ -44,27 +44,27 @@ class tool_log_manager_testcase extends advanced_testcase {
         $this->assertInstanceOf('core\log\manager', $manager);
 
         $stores = $manager->get_readers();
-        $this->assertInternalType('array', $stores);
+        $this->assertIsArray($stores);
         $this->assertCount(2, $stores);
         foreach ($stores as $key => $store) {
-            $this->assertInternalType('string', $key);
+            $this->assertIsString($key);
             $this->assertInstanceOf('core\log\sql_reader', $store);
         }
 
         $stores = $manager->get_readers('core\log\sql_internal_table_reader');
-        $this->assertInternalType('array', $stores);
+        $this->assertIsArray($stores);
         $this->assertCount(1, $stores);
         foreach ($stores as $key => $store) {
-            $this->assertInternalType('string', $key);
+            $this->assertIsString($key);
             $this->assertSame('logstore_standard', $key);
             $this->assertInstanceOf('core\log\sql_internal_table_reader', $store);
         }
 
         $stores = $manager->get_readers('core\log\sql_reader');
-        $this->assertInternalType('array', $stores);
+        $this->assertIsArray($stores);
         $this->assertCount(2, $stores);
         foreach ($stores as $key => $store) {
-            $this->assertInternalType('string', $key);
+            $this->assertIsString($key);
             $this->assertInstanceOf('core\log\sql_reader', $store);
         }
     }
index ae85b86..f697387 100644 (file)
@@ -51,7 +51,7 @@ require_once($CFG->dirroot . '/admin/tool/log/store/standard/tests/fixtures/even
  */
 class tool_log_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
         $this->preventResetByRollback(); // Logging waits till the transaction gets committed.
     }
index 8511c84..338bdeb 100644 (file)
@@ -75,7 +75,7 @@ class tool_lp_external_testcase extends externallib_advanced_testcase {
     /**
      * Setup function- we will create a course and add an assign instance to it.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG;
 
         $this->resetAfterTest(true);
index c8db5c1..b133672 100644 (file)
@@ -46,7 +46,7 @@ class tool_lpmigrate_framework_processor_testcase extends advanced_testcase {
      * Then we create 2 courses, and in each 1 CM.
      * Then we attach some competencies from the first framework to courses and CM.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
         $dg = $this->getDataGenerator();
         $lpg = $dg->get_plugin_generator('core_competency');
index b88a742..0ba834c 100644 (file)
@@ -44,7 +44,7 @@ use tool_messageinbound\privacy\provider;
  */
 class tool_messageinbound_manager_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         global $CFG;
         $this->resetAfterTest();
 
index e98c027..65d6869 100644 (file)
@@ -46,7 +46,7 @@ use tool_messageinbound\privacy\provider;
  */
 class tool_messageinbound_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         global $CFG;
         $this->resetAfterTest();
 
index 18721a2..e9fc4f4 100644 (file)
@@ -132,7 +132,7 @@ class tool_mobile_api_testcase extends externallib_advanced_testcase {
         $email = reset($emails);
 
         // Check we got the promotion text.
-        $this->assertContains($mobileappdownloadpage, quoted_printable_decode($email->body));
+        $this->assertStringContainsString($mobileappdownloadpage, quoted_printable_decode($email->body));
         $sink->clear();
 
         // Disable mobile so we don't get mobile promotions.
@@ -142,7 +142,7 @@ class tool_mobile_api_testcase extends externallib_advanced_testcase {
         $this->assertCount(1, $emails);
         $email = reset($emails);
         // Check we don't get the promotion text.
-        $this->assertNotContains($mobileappdownloadpage, quoted_printable_decode($email->body));
+        $this->assertStringNotContainsString($mobileappdownloadpage, quoted_printable_decode($email->body));
         $sink->clear();
 
         // Enable mobile again and set current user mobile token so we don't get mobile promotions.
@@ -158,7 +158,7 @@ class tool_mobile_api_testcase extends externallib_advanced_testcase {
         $this->assertCount(1, $emails);
         $email = reset($emails);
         // Check we don't get the promotion text.
-        $this->assertNotContains($mobileappdownloadpage, quoted_printable_decode($email->body));
+        $this->assertStringNotContainsString($mobileappdownloadpage, quoted_printable_decode($email->body));
         $sink->clear();
         $sink->close();
     }
index 0909aaf..00d75a6 100644 (file)
@@ -158,11 +158,11 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
 
         $this->assertEquals('Google', $identityproviders[0]['name']);
         $this->assertEquals($irecord->image, $identityproviders[0]['iconurl']);
-        $this->assertContains($CFG->wwwroot, $identityproviders[0]['url']);
+        $this->assertStringContainsString($CFG->wwwroot, $identityproviders[0]['url']);
 
         $this->assertEquals('CAS', $identityproviders[1]['name']);
         $this->assertEmpty($identityproviders[1]['iconurl']);
-        $this->assertContains($CFG->wwwroot, $identityproviders[1]['url']);
+        $this->assertStringContainsString($CFG->wwwroot, $identityproviders[1]['url']);
 
         $this->assertEquals($expected, $result);
 
@@ -171,7 +171,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
         set_config('auth_logo', $newurl, 'auth_cas');
         $result = external::get_public_config();
         $result = external_api::clean_returnvalue(external::get_public_config_returns(), $result);
-        $this->assertContains($newurl, $result['identityproviders'][1]['iconurl']);
+        $this->assertStringContainsString($newurl, $result['identityproviders'][1]['iconurl']);
     }
 
     /**
index 6e1da9c..c1469f4 100644 (file)
@@ -40,7 +40,7 @@ class tool_mobile_privacy_testcase extends \core_privacy\tests\provider_testcase
     /**
      * Basic setup for these tests.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
     }
 
index f74c10b..d6b50a4 100644 (file)
@@ -38,7 +38,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Enable monitor.
         set_config('enablemonitor', 1, 'tool_monitor');
     }
@@ -500,18 +500,18 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
 
         $this->assertRegExp('~<h2>.*' . preg_quote($event->get_url()->out(), '~') . '.*</h2>~', $msg->fullmessagehtml);
         $this->assertRegExp('~<li>.*' . preg_quote($modurl->out(), '~') . '.*</li>~', $msg->fullmessagehtml);
-        $this->assertContains('<li><strong>'.$rule->get_name($context).'</strong></li>', $msg->fullmessagehtml);
-        $this->assertContains('<li>'.$rule->get_description($context).'</li>', $msg->fullmessagehtml);
-        $this->assertContains('<li>'.$rule->get_event_name().'</li>', $msg->fullmessagehtml);
+        $this->assertStringContainsString('<li><strong>'.$rule->get_name($context).'</strong></li>', $msg->fullmessagehtml);
+        $this->assertStringContainsString('<li>'.$rule->get_description($context).'</li>', $msg->fullmessagehtml);
+        $this->assertStringContainsString('<li>'.$rule->get_event_name().'</li>', $msg->fullmessagehtml);
 
         $this->assertEquals(FORMAT_PLAIN, $msg->fullmessageformat);
-        $this->assertNotContains('<h2>', $msg->fullmessage);
-        $this->assertNotContains('##', $msg->fullmessage);
-        $this->assertContains(strtoupper($event->get_url()->out()), $msg->fullmessage);
-        $this->assertContains('* '.$modurl->out(), $msg->fullmessage);
-        $this->assertContains('* '.strtoupper($rule->get_name($context)), $msg->fullmessage);
-        $this->assertContains('* '.$rule->get_description($context), $msg->fullmessage);
-        $this->assertContains('* '.$rule->get_event_name(), $msg->fullmessage);
+        $this->assertStringNotContainsString('<h2>', $msg->fullmessage);
+        $this->assertStringNotContainsString('##', $msg->fullmessage);
+        $this->assertStringContainsString(strtoupper($event->get_url()->out()), $msg->fullmessage);
+        $this->assertStringContainsString('* '.$modurl->out(), $msg->fullmessage);
+        $this->assertStringContainsString('* '.strtoupper($rule->get_name($context)), $msg->fullmessage);
+        $this->assertStringContainsString('* '.$rule->get_description($context), $msg->fullmessage);
+        $this->assertStringContainsString('* '.$rule->get_event_name(), $msg->fullmessage);
     }
 
     /**
index 4ed829d..109bc7f 100644 (file)
@@ -33,7 +33,7 @@ class tool_monitor_events_testcase extends advanced_testcase {
     /**
      * Tests set up.
      */
-    public function setUp() {
+    public function setUp(): void {
         set_config('enablemonitor', 1, 'tool_monitor');
         $this->resetAfterTest();
     }
index 7c4ae86..c2672a8 100644 (file)
@@ -39,7 +39,7 @@ class tool_monitor_generator_testcase extends advanced_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Enable monitor.
         set_config('enablemonitor', 1, 'tool_monitor');
     }
@@ -138,4 +138,4 @@ class tool_monitor_generator_testcase extends advanced_testcase {
         $this->assertEquals(1, $historydata->userid);
         $this->assertEquals(1, $historydata->sid);
     }
-}
\ No newline at end of file
+}
index 3d419c7..871b11d 100644 (file)
@@ -43,7 +43,7 @@ class tool_monitor_privacy_testcase extends provider_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
         // Enable monitor.
         set_config('enablemonitor', 1, 'tool_monitor');
index a5173fa..fd334e6 100644 (file)
@@ -37,7 +37,7 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Enable monitor.
         set_config('enablemonitor', 1, 'tool_monitor');
     }
@@ -192,4 +192,4 @@ class tool_monitor_rule_manager_testcase extends advanced_testcase {
         $this->assertEmpty(array_diff(array_keys($ruledata), $ruleids));
         $this->assertCount(10, $ruledata);
     }
-}
\ No newline at end of file
+}
index b3511b5..364b1c4 100644 (file)
@@ -34,7 +34,7 @@ class tool_monitor_subscription_testcase extends advanced_testcase {
     /**
      * Test set up.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
 
         // Create the mock subscription.
@@ -59,11 +59,10 @@ class tool_monitor_subscription_testcase extends advanced_testcase {
 
     /**
      * Test for the magic __get method.
-     *
-     * @expectedException coding_exception
      */
     public function test_magic_get() {
         $this->assertEquals(20, $this->subscription->courseid);
+        $this->expectException(coding_exception::class);
         $this->subscription->ruleid;
     }
 }
index b526784..10a5e98 100644 (file)
@@ -36,7 +36,7 @@ class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
     /**
      * Test set up.
      */
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
         set_config('enablemonitor', 1, 'tool_monitor');
         $this->resetAfterTest(true);
index 9de3226..5f0a13c 100644 (file)
@@ -35,7 +35,7 @@ class tool_monitor_task_clean_events_testcase extends advanced_testcase {
     /**
      * Test set up.
      */
-    public function setUp() {
+    public function setUp(): void {
         set_config('enablemonitor', 1, 'tool_monitor');
         $this->resetAfterTest(true);
     }
index 8abff00..bec7faa 100644 (file)
@@ -46,7 +46,7 @@ class tool_policy_external_testcase extends externallib_advanced_testcase {
     /**
      * Setup function- we will create some policy docs.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
         $this->setAdminUser();
 
index c771cde..e0d5ea5 100644 (file)
@@ -51,7 +51,7 @@ class tool_policy_privacy_provider_testcase extends \core_privacy\tests\provider
     /**
      * Setup function. Will create a user.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         $this->resetAfterTest();
 
         $generator = $this->getDataGenerator();
@@ -274,13 +274,9 @@ class tool_policy_privacy_provider_testcase extends \core_privacy\tests\provider
         // Request export for the manager.
         $contextlist = provider::get_contexts_for_userid($this->manager->id);
         $this->assertCount(3, $contextlist);
-        $this->assertEquals(
+        $this->assertEqualsCanonicalizing(
             [$managercontext->id, $usercontext->id, $systemcontext->id],
-            $contextlist->get_contextids(),
-            '',
-            0.0,
-            1,
-            true
+            $contextlist->get_contextids()
         );
 
         $approvedcontextlist = new approved_contextlist($this->user, 'tool_policy', [$usercontext->id]);
@@ -332,7 +328,7 @@ class tool_policy_privacy_provider_testcase extends \core_privacy\tests\provider
         // Agree to the policies for oneself.
         $contextlist = provider::get_contexts_for_userid($this->manager->id);
         $this->assertCount(2, $contextlist);
-        $this->assertEquals([$managercontext->id, $systemcontext->id], $contextlist->get_contextids(), '', 0.0, 1, true);
+        $this->assertEqualsCanonicalizing([$managercontext->id, $systemcontext->id], $contextlist->get_contextids());
 
         $approvedcontextlist = new approved_contextlist($this->manager, 'tool_policy', $contextlist->get_contextids());
         provider::export_user_data($approvedcontextlist);
index 0e24c31..199fca0 100644 (file)
@@ -46,7 +46,7 @@ class tool_recyclebin_category_bin_tests extends advanced_testcase {
     /**
      * Setup for each test.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         $this->resetAfterTest();
         $this->setAdminUser();
 
index 44f9db6..87c4e86 100644 (file)
@@ -46,7 +46,7 @@ class tool_recyclebin_course_bin_tests extends advanced_testcase {
     /**
      * Setup for each test.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         $this->resetAfterTest(true);
         $this->setAdminUser();
 
index c3ea0e6..c7be87b 100644 (file)
@@ -40,7 +40,7 @@ class tool_recyclebin_events_testcase extends advanced_testcase {
      *
      * This is executed before running any test in this file.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
 
         // We want the category and course bin to be enabled.
index 5dc0ff0..aba224e 100644 (file)
@@ -75,7 +75,7 @@ class tool_templatelibrary_external_testcase extends externallib_advanced_testca
         $template = external::load_canonical_template('core', 'notification_error');
 
         // Only the base template should contain the docs.
-        $this->assertContains('@template core/notification_error', $template);
+        $this->assertStringContainsString('@template core/notification_error', $template);
 
         // Restore the original theme.
         $CFG->theme = $originaltheme;
index 9bd1f4e..cd3dd41 100644 (file)
@@ -35,21 +35,16 @@ global $CFG;
  */
 class tool_uploadcourse_course_testcase extends advanced_testcase {
 
-    /**
-     * @expectedException coding_exception
-     */
     public function test_proceed_without_prepare() {
         $this->resetAfterTest(true);
         $mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
         $updatemode = tool_uploadcourse_processor::UPDATE_NOTHING;
         $data = array();
         $co = new tool_uploadcourse_course($mode, $updatemode, $data);
+        $this->expectException(coding_exception::class);
         $co->proceed();
     }
 
-    /**
-     * @expectedException moodle_exception
-     */
     public function test_proceed_when_prepare_failed() {
         $this->resetAfterTest(true);
         $mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
@@ -57,6 +52,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
         $data = array();
         $co = new tool_uploadcourse_course($mode, $updatemode, $data);
         $this->assertFalse($co->prepare());
+        $this->expectException(moodle_exception::class);
         $co->proceed();
     }
 
@@ -1232,9 +1228,9 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
 
         // Confirm presence of course custom fields.
         $data = \core_course\customfield\course_handler::create()->export_instance_data_object($course->id);
-        $this->assertEquals('Wednesday, 1 April 2020, 4:00 PM', $data->mydatefield, '', 0.0, 10, false, true);
+        $this->assertEqualsIgnoringCase('Wednesday, 1 April 2020, 4:00 PM', $data->mydatefield);
         $this->assertEquals($dataupload['customfield_mytextfield'], $data->mytextfield);
-        $this->assertContains($dataupload['customfield_mytextareafield'], $data->mytextareafield);
+        $this->assertStringContainsString($dataupload['customfield_mytextareafield'], $data->mytextareafield);
     }
 
     /**
@@ -1504,4 +1500,4 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
             'configdata' => $configdata,
         ]);
     }
-}
\ No newline at end of file
+}
index 109c243..b23c035 100644 (file)
@@ -160,9 +160,6 @@ class tool_uploadcourse_processor_testcase extends advanced_testcase {
         $this->assertEquals('ID123: Course 1', $c->shortname);
     }
 
-    /**
-     * @expectedException moodle_exception
-     */
     public function test_empty_csv() {
         $this->resetAfterTest(true);
 
@@ -174,12 +171,10 @@ class tool_uploadcourse_processor_testcase extends advanced_testcase {
         $cir->init();
 
         $options = array('mode' => tool_uploadcourse_processor::MODE_CREATE_NEW);
+        $this->expectException(moodle_exception::class);
         $p = new tool_uploadcourse_processor($cir, $options, array());
     }
 
-    /**
-     * @expectedException moodle_exception
-     */
     public function test_not_enough_columns() {
         $this->resetAfterTest(true);
 
@@ -194,6 +189,7 @@ class tool_uploadcourse_processor_testcase extends advanced_testcase {
         $cir->init();
 
         $options = array('mode' => tool_uploadcourse_processor::MODE_CREATE_NEW);
+        $this->expectException(moodle_exception::class);
         $p = new tool_uploadcourse_processor($cir, $options, array());
     }
 
index 642ee0c..b60247f 100644 (file)
@@ -36,7 +36,7 @@ use tool_usertours\local\filter\accessdate;
  */
 class tool_usertours_accessdate_filter_test extends advanced_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
     }
 
index 4e0c2b1..557e075 100644 (file)
@@ -248,7 +248,7 @@ class cache_testcase extends advanced_testcase {
         $tour = $this->helper_create_tour((object)['enabled' => false]);
 
         $data = \tool_usertours\cache::get_stepdata($tour->get_id());
-        $this->assertInternalType('array', $data);
+        $this->assertIsArray($data);
         $this->assertEmpty($data);
     }
 
@@ -265,11 +265,11 @@ class cache_testcase extends advanced_testcase {
         $tour2 = $this->helper_create_tour((object)['enabled' => false]);
 
         $data = \tool_usertours\cache::get_stepdata($tour1->get_id());
-        $this->assertInternalType('array', $data);
+        $this->assertIsArray($data);
         $this->assertCount(3, $data);
 
         $data = \tool_usertours\cache::get_stepdata($tour2->get_id());
-        $this->assertInternalType('array', $data);
+        $this->assertIsArray($data);
         $this->assertEmpty($data);
     }
 
@@ -292,7 +292,7 @@ class cache_testcase extends advanced_testcase {
         $steps[0]->set_sortorder(10)->persist();
 
         $data = \tool_usertours\cache::get_stepdata($tour->get_id());
-        $this->assertInternalType('array', $data);
+        $this->assertIsArray($data);
         $this->assertCount(4, $data);
 
         // Re-order the steps.
index d5e4893..0deff0d 100644 (file)
@@ -47,7 +47,7 @@ class tool_usertours_manager_testcase extends advanced_testcase {
     /**
      * Setup to store the DB reference.
      */
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->db = $DB;
@@ -56,7 +56,7 @@ class tool_usertours_manager_testcase extends advanced_testcase {
     /**
      * Tear down to restore the original DB reference.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         global $DB;
 
         $DB = $this->db;
index 8e552e1..4c580c0 100644 (file)
@@ -183,6 +183,6 @@ class tool_usertours_privacy_provider_testcase extends \core_privacy\tests\provi
         $this->assertCount(1, (array) $prefs);
 
         // The preference should be related to the first tour.
-        $this->assertContains($tour1->get_name(), reset($prefs)->description);
+        $this->assertStringContainsString($tour1->get_name(), reset($prefs)->description);
     }
 }
index 940e517..8fe9739 100644 (file)
@@ -58,7 +58,7 @@ class tool_usertours_role_filter_testcase extends advanced_testcase {
      */
     protected $roles;
 
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->resetAfterTest(true);
index 005272e..fb6a3c1 100644 (file)
@@ -44,7 +44,7 @@ class step_testcase extends advanced_testcase {
     /**
      * Setup to store the DB reference.
      */
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->db = $DB;
@@ -53,7 +53,7 @@ class step_testcase extends advanced_testcase {
     /**
      * Tear down to restore the original DB reference.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         global $DB;
 
         $DB = $this->db;
index c5bf23f..d1014f7 100644 (file)
@@ -46,7 +46,7 @@ class tour_testcase extends advanced_testcase {
     /**
      * Setup to store the DB reference.
      */
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->db = $DB;
@@ -55,7 +55,7 @@ class tour_testcase extends advanced_testcase {
     /**
      * Tear down to restore the original DB reference.
      */
-    public function tearDown() {
+    public function tearDown(): void {
         global $DB;
 
         $DB = $this->db;
index 5385c29..5fc63d4 100644 (file)
@@ -1492,6 +1492,17 @@ class model {
             $prediction->get_prediction_data()->contextid, $prediction->get_sample_data());
     }
 
+    /**
+     * Returns the default output directory for prediction processors
+     *
+     * @return string
+     */
+    public static function default_output_dir(): string {
+        global $CFG;
+
+        return $CFG->dataroot . DIRECTORY_SEPARATOR . 'models';
+    }
+
     /**
      * Returns the output directory for prediction processors.
      *
@@ -1506,8 +1517,6 @@ class model {
      * @return string
      */
     public function get_output_dir($subdirs = array(), $onlymodelid = false) {
-        global $CFG;
-
         $subdirstr = '';
         foreach ($subdirs as $subdir) {
             $subdirstr .= DIRECTORY_SEPARATOR . $subdir;
@@ -1516,7 +1525,7 @@ class model {
         $outputdir = get_config('analytics', 'modeloutputdir');
         if (empty($outputdir)) {
             // Apply default value.
-            $outputdir = rtrim($CFG->dataroot, '/') . DIRECTORY_SEPARATOR . 'models';
+            $outputdir = self::default_output_dir();
         }
 
         // Append model id.
index 00cfea3..13010f9 100644 (file)
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
  */
 class core_analytics_course_testcase extends advanced_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->course = $this->getDataGenerator()->create_course(['startdate' => 0]);
index f5c916c..b877e72 100644 (file)
@@ -38,7 +38,7 @@ class dataset_manager_testcase extends advanced_testcase {
      *
      * @return null
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
 
         $this->sharedtoprows = array(
@@ -60,10 +60,10 @@ class dataset_manager_testcase extends advanced_testcase {
         $f1 = $dataset1->store($dataset1data);
 
         $f1contents = $f1->get_content();
-        $this->assertContains('yeah', $f1contents);
-        $this->assertContains('var1', $f1contents);
-        $this->assertContains('value1', $f1contents);
-        $this->assertContains('header1', $f1contents);
+        $this->assertStringContainsString('yeah', $f1contents);
+        $this->assertStringContainsString('var1', $f1contents);
+        $this->assertStringContainsString('value1', $f1contents);
+        $this->assertStringContainsString('header1', $f1contents);
     }
 
     /**
@@ -86,11 +86,11 @@ class dataset_manager_testcase extends advanced_testcase {
             \core_analytics\dataset_manager::LABELLED_FILEAREA);
 
         $mergedfilecontents = $merged->get_content();
-        $this->assertContains('yeah', $mergedfilecontents);
-        $this->assertContains('no', $mergedfilecontents);
-        $this->assertContains('var1', $mergedfilecontents);
-        $this->assertContains('value1', $mergedfilecontents);
-        $this->assertContains('header1', $mergedfilecontents);
+        $this->assertStringContainsString('yeah', $mergedfilecontents);
+        $this->assertStringContainsString('no', $mergedfilecontents);
+        $this->assertStringContainsString('var1', $mergedfilecontents);
+        $this->assertStringContainsString('value1', $mergedfilecontents);
+        $this->assertStringContainsString('header1', $mergedfilecontents);
     }
 
     /**
index add3f3d..ff7ff0c 100644 (file)
@@ -70,7 +70,6 @@ class analytics_indicator_testcase extends advanced_testcase {
      * @param string $indicatorclass
      * @param string $willreturn
      * @dataProvider validate_calculated_value_exceptions
-     * @expectedException \coding_exception
      * @return null
      */
     public function test_validate_calculated_value_exceptions($indicatorclass, $willreturn) {
@@ -80,6 +79,7 @@ class analytics_indicator_testcase extends advanced_testcase {
             ->setMethods(['calculate_sample'])
             ->getMock();
         $indicatormock->method('calculate_sample')->willReturn($willreturn);
+        $this->expectException(coding_exception::class);
         list($values, $unused) = $indicatormock->calculate([1], 'notrelevanthere');
 
     }
index 9d5bdd2..c4a5c5c 100644 (file)
@@ -41,7 +41,7 @@ require_once(__DIR__ . '/fixtures/test_analysis.php');
  */
 class analytics_model_testcase extends advanced_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
 
         $this->setAdminUser();
 
@@ -424,7 +424,7 @@ class analytics_model_testcase extends advanced_testcase {
         $modeldata = $method->invoke($modelconfig);
 
         $this->assertArrayHasKey('core', $modeldata->dependencies);
-        $this->assertInternalType('float', $modeldata->dependencies['core']);
+        $this->assertIsFloat($modeldata->dependencies['core']);
         $this->assertNotEmpty($modeldata->target);
         $this->assertNotEmpty($modeldata->timesplitting);
         $this->assertCount(3, $modeldata->indicators);
index f376878..f8f2866 100644 (file)
@@ -39,7 +39,7 @@ class analytics_prediction_actions_testcase extends advanced_testcase {
     /**
      * Common startup tasks
      */
-    public function setUp() {
+    public function setUp(): void {
         global $DB;
 
         $this->setAdminUser();
index 1fd9ac2..159bfd8 100644 (file)
@@ -62,7 +62,7 @@ class core_analytics_prediction_testcase extends advanced_testcase {
      *
      * @return null
      */
-    public function tearDown() {
+    public function tearDown(): void {
         $this->setAdminUser();
 
         $models = \core_analytics\manager::get_all_models();
index 21fdd28..d0fa280 100644 (file)
@@ -44,7 +44,7 @@ require_once(__DIR__ . '/fixtures/test_target_course_users.php');
  */
 class core_analytics_privacy_model_testcase extends \core_privacy\tests\provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
 
         $this->resetAfterTest(true);
         $this->setAdminUser();
index 5054a3f..5d3cb03 100644 (file)
@@ -39,7 +39,7 @@ class analytics_stats_testcase extends advanced_testcase {
     /**
      * Set up the test environment.
      */
-    public function setUp() {
+    public function setUp(): void {
 
         $this->setAdminUser();
     }
index f62f95c..ed1900a 100644 (file)
@@ -43,7 +43,7 @@ class auth_email_external_testcase extends externallib_advanced_testcase {
     /**
      * Set up for every test
      */
-    public function setUp() {
+    public function setUp(): void {
         global $CFG, $DB;
 
         $this->resetAfterTest(true);
index 156a997..7857e34 100644 (file)
@@ -44,7 +44,7 @@ class auth_manual_testcase extends advanced_testcase {
     /**
      * Setup test data.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         $this->resetAfterTest(true);
         $this->authplugin = new auth_plugin_manual();
         set_config('expiration', '1', 'auth_manual');
index 5572291..af741c3 100644 (file)
@@ -45,7 +45,7 @@ class auth_manual_privacy_testcase extends \core_privacy\tests\provider_testcase
     /**
      * Basic setup for these tests.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest(true);
         $this->authplugin = new auth_plugin_manual();
     }
index 7ecf9e6..b41db22 100644 (file)
@@ -43,7 +43,7 @@ class auth_mnet_privacy_testcase extends provider_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
         $this->setAdminUser();
     }
index ab5b2ff..4582d70 100644 (file)
@@ -42,12 +42,9 @@ class auth_oauth2_auth_testcase extends advanced_testcase {
         $auth = get_auth_plugin($user->auth);
         $info = $auth->get_password_change_info($user);
 
-        $this->assertEquals(
-                ['subject', 'message'],
-                array_keys($info),
-                '', 0.0, 10, true);
-        $this->assertContains(
+        $this->assertEqualsCanonicalizing(['subject', 'message'], array_keys($info));
+        $this->assertStringContainsString(
                 'your password cannot be reset because you are using your account on another site to log in',
                 $info['message']);
     }
-}
\ No newline at end of file
+}
index d582d0a..1e190cf 100644 (file)
@@ -42,7 +42,7 @@ class auth_oauth2_privacy_testcase extends provider_testcase {
     /**
      * Set up method.
      */
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
         $this->setAdminUser();
     }
index 237852c..f3f53d5 100644 (file)
@@ -46,7 +46,7 @@ class core_auth_external_testcase extends externallib_advanced_testcase {
     /**
      * Set up for every test
      */
-    public function setUp() {
+    public function setUp(): void {
         global $CFG;
 
         $this->resetAfterTest(true);
@@ -60,7 +60,7 @@ class core_auth_external_testcase extends externallib_advanced_testcase {
     /**
      * Tear down to restore old logging..
      */
-    protected function tearDown() {
+    protected function tearDown(): void {
         ini_set('error_log', $this->oldlog);
         parent::tearDown();
     }
index 16701f2..d3586d3 100644 (file)
@@ -43,7 +43,7 @@ use core_auth\privacy\provider;
  */
 class core_auth_privacy_testcase extends provider_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         $this->resetAfterTest();
     }
 
index b1a0040..4526198 100644 (file)
@@ -52,7 +52,7 @@ class availability_completion_condition_testcase extends advanced_testcase {
     /**
      * Load required classes.
      */
-    public function setUp() {
+    public function setUp(): void {
         availability_completion\condition::wipe_static_cache();
     }
 
@@ -116,7 +116,7 @@ class availability_completion_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->cm', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->cm', $e->getMessage());
         }
 
         // Invalid $cm.
@@ -125,7 +125,7 @@ class availability_completion_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->cm', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->cm', $e->getMessage());
         }
 
         // Missing $e.
@@ -134,7 +134,7 @@ class availability_completion_condition_testcase extends advanced_testcase {
   &n