Merge branch 'MDL-69788' of https://github.com/paulholden/moodle
authorAdrian Greeve <abgreeve@gmail.com>
Thu, 22 Oct 2020 01:08:50 +0000 (09:08 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Thu, 22 Oct 2020 01:08:50 +0000 (09:08 +0800)
653 files changed:
.gitignore
admin/classes/form/testoutgoingmailconf_form.php
admin/roles/tests/privacy_test.php
admin/settings/analytics.php
admin/settings/server.php
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/classes/manager.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/cc/cc2moodle.php
backup/cc/entities.class.php
backup/controller/tests/controller_test.php
backup/converter/moodle1/tests/moodle1_converter_test.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
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/site_main_menu/block_site_main_menu.php
blocks/social_activities/block_social_activities.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/classes/local/event/strategies/raw_event_retrieval_strategy.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/classes/local/service/content_item_service.php
course/classes/search/customfield.php
course/format/weeks/tests/observer_test.php
course/renderer.php
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
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/edit/tree/item.php
grade/edit/tree/item_form.php
grade/edit/tree/lib.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/module.js
grade/report/grader/tests/behat/ajax_grader.feature
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/classes/player.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
iplookup/tests/geoip_test.php
iplookup/tests/geoplugin_test.php
lang/en/admin.php
lang/en/analytics.php
lang/en/deprecated.txt
lib/adminlib.php
lib/antivirus/clamav/tests/scanner_test.php
lib/blocklib.php
lib/classes/plugin_manager.php
lib/classes/session/manager.php
lib/db/upgrade.php
lib/ddl/tests/ddl_test.php
lib/dml/moodle_database.php
lib/dml/mysqli_native_moodle_database.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/filemanager.js
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/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/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/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/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/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/classes/external.php
mod/lti/db/install.xml
mod/lti/db/upgrade.php
mod/lti/locallib.php
mod/lti/service/gradebookservices/tests/privacy_provider_test.php
mod/lti/service/gradebookservices/tests/task_cleanup_test.php
mod/lti/service/memberships/tests/privacy_provider_test.php
mod/lti/tests/externallib_test.php
mod/lti/tests/lib_test.php
mod/lti/tests/task_clean_access_tokens_test.php
mod/lti/upgrade.txt
mod/lti/version.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/behat/behat_filepicker.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/behat/setup_search_engine.feature [new file with mode: 0644]
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/blocks.scss
theme/boost/scss/moodle/calendar.scss
theme/boost/scss/moodle/core.scss
theme/boost/scss/moodle/grade.scss
theme/boost/scss/moodle/icons.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 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 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 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 437b416..9d76b2e 100644 (file)
@@ -637,11 +637,13 @@ class manager {
         $tours = cache::get_matching_tourdata($pageurl);
 
         $matches = [];
-        $filters = helper::get_all_filters();
-        foreach ($tours as $record) {
-            $tour = tour::load_from_record($record);
-            if ($tour->is_enabled() && $tour->matches_all_filters($PAGE->context, $filters)) {
-                $matches[] = $tour;
+        if ($tours) {
+            $filters = helper::get_all_filters();
+            foreach ($tours as $record) {
+                $tour = tour::load_from_record($record);
+                if ($tour->is_enabled() && $tour->matches_all_filters($PAGE->context, $filters)) {
+                    $matches[] = $tour;
+                }
             }
         }
 
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 {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->e', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->e', $e->getMessage());
         }
 
         // Invalid $e.
@@ -143,7 +143,7 @@ class availability_completion_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->e', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->e', $e->getMessage());
         }
 
         // Successful construct & display with all different expected values.
index 7b62904..d6186ae 100644 (file)
@@ -38,7 +38,7 @@ class availability_date_condition_testcase extends advanced_testcase {
     /**
      * Load required classes.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Load the mock info class so that it can be used.
         global $CFG;
         require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php');
@@ -96,7 +96,7 @@ class availability_date_condition_testcase extends advanced_testcase {
             $date = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->d', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->d', $e->getMessage());
         }
 
         // Invalid ->d.
@@ -105,7 +105,7 @@ class availability_date_condition_testcase extends advanced_testcase {
             $date = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->d', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->d', $e->getMessage());
         }
 
         // Missing ->t.
@@ -114,7 +114,7 @@ class availability_date_condition_testcase extends advanced_testcase {
             $date = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->t', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->t', $e->getMessage());
         }
 
         // Invalid ->t.
@@ -123,7 +123,7 @@ class availability_date_condition_testcase extends advanced_testcase {
             $date = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->t', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->t', $e->getMessage());
         }
 
         // Valid conditions of both types.
index 8f2eb02..f0968c1 100644 (file)
@@ -149,7 +149,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->id', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->id', $e->getMessage());
         }
 
         // Invalid id (not int).
@@ -158,7 +158,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->id', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->id', $e->getMessage());
         }
 
         // Invalid min (not number).
@@ -168,7 +168,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->min', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->min', $e->getMessage());
         }
 
         // Invalid max (not number).
@@ -178,7 +178,7 @@ class availability_grade_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->max', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->max', $e->getMessage());
         }
 
         // All valid.
index 1c94323..10f9a83 100644 (file)
@@ -37,7 +37,7 @@ class availability_group_condition_testcase extends advanced_testcase {
     /**
      * Load required classes.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Load the mock info class so that it can be used.
         global $CFG;
         require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php');
@@ -122,7 +122,7 @@ class availability_group_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->id', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->id', $e->getMessage());
         }
 
         // Valid (with id).
index 94cd4ec..3a03610 100644 (file)
@@ -37,7 +37,7 @@ class availability_grouping_condition_testcase extends advanced_testcase {
     /**
      * Load required classes.
      */
-    public function setUp() {
+    public function setUp(): void {
         // Load the mock info class so that it can be used.
         global $CFG;
         require_once($CFG->dirroot . '/availability/tests/fixtures/mock_info.php');
@@ -132,7 +132,7 @@ class availability_grouping_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing ->id / ->activity', $e->getMessage());
+            $this->assertStringContainsString('Missing ->id / ->activity', $e->getMessage());
         }
 
         // Invalid id (not int).
@@ -141,7 +141,7 @@ class availability_grouping_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->id', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->id', $e->getMessage());
         }
 
         // Invalid activity option (not bool).
@@ -151,7 +151,7 @@ class availability_grouping_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->activity', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->activity', $e->getMessage());
         }
 
         // Invalid activity option (false).
@@ -160,7 +160,7 @@ class availability_grouping_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->activity', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->activity', $e->getMessage());
         }
 
         // Valid with id.
index e2250e2..6ec42c5 100644 (file)
@@ -45,7 +45,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
     /** @var \core_availability\info Current info */
     private $info;
 
-    public function setUp() {
+    public function setUp(): void {
         global $DB, $CFG;
 
         $this->resetAfterTest();
@@ -105,7 +105,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->op', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->op', $e->getMessage());
         }
 
         // Invalid op.
@@ -114,7 +114,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->op', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->op', $e->getMessage());
         }
 
         // Missing value.
@@ -123,7 +123,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->v', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->v', $e->getMessage());
         }
 
         // Invalid value (not string).
@@ -132,7 +132,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing or invalid ->v', $e->getMessage());
+            $this->assertStringContainsString('Missing or invalid ->v', $e->getMessage());
         }
 
         // Unexpected value.
@@ -141,7 +141,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Unexpected ->v', $e->getMessage());
+            $this->assertStringContainsString('Unexpected ->v', $e->getMessage());
         }
 
         // Missing field.
@@ -151,7 +151,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Missing ->sf or ->cf', $e->getMessage());
+            $this->assertStringContainsString('Missing ->sf or ->cf', $e->getMessage());
         }
 
         // Invalid field (not string).
@@ -160,7 +160,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->sf', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->sf', $e->getMessage());
         }
 
         // Both fields.
@@ -170,7 +170,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Both ->sf and ->cf', $e->getMessage());
+            $this->assertStringContainsString('Both ->sf and ->cf', $e->getMessage());
         }
 
         // Invalid ->cf field (not string).
@@ -180,7 +180,7 @@ class availability_profile_condition_testcase extends advanced_testcase {
             $cond = new condition($structure);
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Invalid ->cf', $e->getMessage());
+            $this->assertStringContainsString('Invalid ->cf', $e->getMessage());
         }
 
         // Valid examples (checks values are correctly included).
index e8044df..2510ac9 100644 (file)
@@ -36,7 +36,7 @@ use core_availability\info_section;
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class info_testcase extends advanced_testcase {
-    public function setUp() {
+    public function setUp(): void {
         // Load the mock condition so that it can be used.
         require_once(__DIR__ . '/fixtures/mock_condition.php');
     }
@@ -91,7 +91,7 @@ class info_testcase extends advanced_testcase {
         $debugging = $this->getDebuggingMessages();
         $this->resetDebugging();
         $this->assertEquals(1, count($debugging));
-        $this->assertContains('Invalid availability', $debugging[0]->message);
+        $this->assertStringContainsString('Invalid availability', $debugging[0]->message);
 
         // Check empty one.
         $info = new info_module($cm4);
@@ -145,7 +145,7 @@ class info_testcase extends advanced_testcase {
         $debugging = $this->getDebuggingMessages();
         $this->resetDebugging();
         $this->assertEquals(1, count($debugging));
-        $this->assertContains('Invalid availability', $debugging[0]->message);
+        $this->assertStringContainsString('Invalid availability', $debugging[0]->message);
 
         // Check empty one.
         $info = new info_section($sections[4]);
index 1b131a9..0bf6290 100644 (file)
@@ -35,7 +35,7 @@ defined('MOODLE_INTERNAL') || die();
  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class tree_testcase extends \advanced_testcase {
-    public function setUp() {
+    public function setUp(): void {
         // Load the mock classes so they can be used.
         require_once(__DIR__ . '/fixtures/mock_condition.php');
         require_once(__DIR__ . '/fixtures/mock_info.php');
@@ -49,83 +49,83 @@ class tree_testcase extends \advanced_testcase {
             new tree('frog');
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('not object', $e->getMessage());
+            $this->assertStringContainsString('not object', $e->getMessage());
         }
         try {
             new tree((object)array());
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('missing ->op', $e->getMessage());
+            $this->assertStringContainsString('missing ->op', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '*'));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('unknown ->op', $e->getMessage());
+            $this->assertStringContainsString('unknown ->op', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|'));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('missing ->show', $e->getMessage());
+            $this->assertStringContainsString('missing ->show', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => 0));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('->show not bool', $e->getMessage());
+            $this->assertStringContainsString('->show not bool', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '&'));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('missing ->showc', $e->getMessage());
+            $this->assertStringContainsString('missing ->showc', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '&', 'showc' => 0));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('->showc not array', $e->getMessage());
+            $this->assertStringContainsString('->showc not array', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '&', 'showc' => array(0)));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('->showc value not bool', $e->getMessage());
+            $this->assertStringContainsString('->showc value not bool', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => true));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('missing ->c', $e->getMessage());
+            $this->assertStringContainsString('missing ->c', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => true,
                     'c' => 'side'));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('->c not array', $e->getMessage());
+            $this->assertStringContainsString('->c not array', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => true,
                     'c' => array(3)));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('child not object', $e->getMessage());
+            $this->assertStringContainsString('child not object', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => true,
                     'c' => array((object)array('type' => 'doesnotexist'))));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('Unknown condition type: doesnotexist', $e->getMessage());
+            $this->assertStringContainsString('Unknown condition type: doesnotexist', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '|', 'show' => true,
                     'c' => array((object)array())));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('missing ->op', $e->getMessage());
+            $this->assertStringContainsString('missing ->op', $e->getMessage());
         }
         try {
             new tree((object)array('op' => '&',
@@ -134,7 +134,7 @@ class tree_testcase extends \advanced_testcase {
                     ));
             $this->fail();
         } catch (coding_exception $e) {
-            $this->assertContains('->c, ->showc mismatch', $e->getMessage());
+            $this->assertStringContainsString('->c, ->showc mismatch', $e->getMessage());
         }
     }
 
index 88895a9..245065a 100644 (file)
@@ -794,7 +794,7 @@ class cc2moodle {
         }
     }
 
-    protected function critical_error ($text) {
+    protected static function critical_error ($text) {
 
         $path_to_log = static::log_file();
 
index 4a8ef06..712b84f 100644 (file)
@@ -76,7 +76,7 @@ class entities {
         cc2moodle::log_action('Load the XML resource file: '.$path_to_file);
 
         if (!$resource->load($path_to_file)) {
-            cc2moodle::log_action('Cannot load the XML resource file: ' . $path_to_file, true);
+            cc2moodle::log_action('Cannot load the XML resource file: ' . $path_to_file, false);
         }
 
         return $resource;
index f638be0..5c93fb6 100644 (file)
@@ -38,7 +38,7 @@ class core_backup_controller_testcase extends advanced_testcase {
     protected $courseid;  // course id used for testing
     protected $userid;    // user used if for testing
 
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG;
 
         $this->resetAfterTest(true);
index 68589da..d8ece4b 100644 (file)
@@ -41,7 +41,7 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
     /** @var string saved hash of an icon file used during testing */
     protected $iconhash;
 
-    protected function setUp() {
+    protected function setUp(): void {
         global $CFG;
 
         $this->tempdir = convert_helper::generate_id('unittest');
@@ -75,7 +75,7 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
         );
     }
 
-    protected function tearDown() {
+    protected function tearDown(): void {
         global $CFG;
         if (empty($CFG->keeptempdirectoriesonbackup)) {
             fulldelete($this->tempdirpath);
@@ -92,17 +92,12 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
         $this->assertInstanceOf('moodle1_converter', $converter);
     }
 
-    /**
-     * @expectedException moodle1_convert_storage_exception
-     */
     public function test_stash_storage_not_created() {
         $converter = convert_factory::get_converter('moodle1', $this->tempdir);
+        $this->expectException(moodle1_convert_storage_exception::class);
         $converter->set_stash('tempinfo', 12);
     }
 
-    /**
-     * @expectedException moodle1_convert_empty_storage_exception
-     */
     public function test_stash_requiring_empty_stash() {
         $this->resetAfterTest(true);
         $converter = convert_factory::get_converter('moodle1', $this->tempdir);
@@ -113,6 +108,7 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
 
         } catch (moodle1_convert_empty_storage_exception $e) {
             // we must drop the storage here so we are able to re-create it in the next test
+            $this->expectException(moodle1_convert_empty_storage_exception::class);
             $converter->drop_stash_storage();
             throw new moodle1_convert_empty_storage_exception('rethrowing');
         }
@@ -440,9 +436,6 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
         $this->assertSame(null, $data['nothing']);
     }
 
-    /**
-     * @expectedException convert_path_exception
-     */
     public function test_grouped_data_on_nongrouped_convert_path() {
         // prepare some grouped data
         $data = array(
@@ -468,12 +461,10 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
         $path = new convert_path('beer_style', '/ROOT/BEER_STYLES/BEER_STYLE');
 
         // an attempt to apply recipes throws exception because we do not expect grouped data
+        $this->expectException(convert_path_exception::class);
         $data = $path->apply_recipes($data);
     }
 
-    /**
-     * @expectedException convert_path_exception
-     */
     public function test_grouped_convert_path_with_recipes() {
         // prepare some grouped data
         $data = array(
@@ -501,6 +492,7 @@ class core_backup_moodle1_converter_testcase extends advanced_testcase {
         $this->assertEquals('Heineken', $data['beers'][1]['beer']['name']);
 
         // an attempt to provide explicit recipes on grouped elements throws exception
+        $this->expectException(convert_path_exception::class);
         $path = new convert_path(
             'beer_style', '/ROOT/BEER_STYLES/BEER_STYLE',
             array(
index 5a609c8..d8397e0 100644 (file)
@@ -31,7 +31,7 @@ require_once($CFG->dirroot . '/backup/moodle2/backup_custom_fields.php');
 
 class core_backup_encrypted_content_testscase extends advanced_testcase {
 
-    public function setUp() {
+    public function setUp(): void {
         if (!function_exists('openssl_encrypt')) {
             $this->markTestSkipped('OpenSSL extension is not loaded.');
 
index 554aa0b..658f6c1 100644 (file)
@@ -42,7 +42,7 @@ class backup_xml_transformer_testcase extends advanced_testcase {
     /**
      * Initial set up.
      */
-    public function setUp() {
+    public function setUp(): void {
         parent::setUp();
 
         $this->resetAfterTest(true);
index 9ac514f..c76d952 100644 (file)
@@ -46,7 +46,7 @@ class core_backup_automated_backup_testcase extends advanced_testcase {
      */
     protected $course;
 
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG;
 
         $this->resetAfterTest(true);
index 906dbfe..40f2168 100644 (file)
@@ -66,7 +66,7 @@ class core_backup_course_copy_testcase extends advanced_testcase {
     /**
      * Set up tasks for all tests.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG, $USER;
 
         $this->resetAfterTest(true);
@@ -633,4 +633,4 @@ class core_backup_course_copy_testcase extends advanced_testcase {
         $this->expectException(\moodle_exception::class);
         new \core_backup\copy\copy($formdata);
     }
-}
\ No newline at end of file
+}
index 8cb6e4d..df2b153 100644 (file)
@@ -44,7 +44,7 @@ class backup_external_testcase extends externallib_advanced_testcase {
     /**
      * Set up tasks for all tests.
      */
-    protected function setUp() {
+    protected function setUp(): void {
         global $CFG;
 
         $this->resetAfterTest(true);
@@ -179,4 +179,4 @@ class backup_external_testcase extends externallib_advanced_testcase {
         $this->assertEquals(0, $restorerec->progress);
         $this->assertEquals('restore', $restorerec->operation);
     }
-}
\ No newline at end of file
+}
index 4bec91e..aec7eb6 100644 (file)
@@ -482,7 +482,7 @@ class core_backup_privacy_provider_testcase extends \core_privacy\tests\provider
         $this->assertCount(2, $userlist1);
         $expected = [$user1->id, $user2->id];
         $actual = $userlist1->get_userids();
-        $this->assertEquals($expected, $actual, '', 0.0, 10, true);
+        $this->assertEqualsCanonicalizing($expected, $actual);
 
         // The list of users for coursecontext2 should not return users.
         $userlist2 = new \core_privacy\local\request\userlist($coursecontext2, $component);
index 8e4ced3..3b89043 100644 (file)
@@ -39,7 +39,7 @@ class backup_check_testcase extends advanced_testcase {
     protected $courseid;  // course id used for testing
     protected $userid;    // user record id
 
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG;
         parent::setUp();
 
index 219b530..7a18eb0 100644 (file)
@@ -37,7 +37,7 @@ class backup_dbops_testcase extends advanced_testcase {
     protected $courseid;  // course id used for testing
     protected $userid;      // user record used for testing
 
-    protected function setUp() {
+    protected function setUp(): void {
         global $DB, $CFG;
         parent::setUp();