moodle/lib/tests
Simey Lameze 5b0282847e MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:28:52 +08:00
..
behat MDL-71364 behat: fix randomness causes by "now" advancing 2021-04-17 12:31:23 +02:00
content/export MDL-71036 phpunit: Mock->setMethods() silently deprecated 2021-03-11 23:04:31 +01:00
event MDL-69331 core_contentbank: Hide disabled H5P content-types 2021-04-15 09:16:32 +02:00
external MDL-69215 output: Correct font awesome for themes 2020-07-16 07:29:22 +08:00
fixtures MDL-65284 analytics: Final deprecation get_analysables() 2020-12-16 12:47:52 +01:00
navigation/views MDL-70207 core_navigation: Primary nav unit tests 2021-04-06 11:45:44 +08:00
other MDL-68477 libraries: add legend option examples to test page 2020-04-23 09:23:21 +08:00
output MDL-69215 output: Correct use of icon_system::instance 2020-07-16 07:29:22 +08:00
performance
plugininfo MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
accesslib_has_capability_test.php MDL-68974 admin: Unit tests for loginas 2020-09-08 08:54:26 +02:00
accesslib_test.php MDL-71036 phpunit: Mock->setMethods() silently deprecated 2021-03-11 23:04:31 +01:00
adhoc_task_test.php MDL-67980 tasks: Sort ad-hoc tasks by nextruntime. 2020-02-24 09:30:09 +11:00
adminlib_test.php MDL-69746 tool_replace: additional skip tables 2020-10-02 14:57:18 +10:00
admintree_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
ajaxlib_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
analysers_test.php MDL-65284 analytics: Final deprecation get_analysables() 2020-12-16 12:47:52 +01:00
antivirus_test.php MDL-71036 phpunit: Renamed various file-related assertions 2021-03-11 19:22:23 +01:00
authlib_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
blocklib_test.php MDL-67673 phpunit: Remove deprecated assertEquals() params 2020-10-21 12:46:00 +02:00
calendar_cron_task_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
check_test.php MDL-67818 check: Added Check API and refactored security checks 2020-04-06 12:28:37 +10:00
collator_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
completion_daily_task_test.php MDL-69256 tests: Fix random slow test failures in completion cron 2021-03-23 08:07:49 +08:00
completionlib_test.php MDL-71104 core_completion: Fix fetching of grade completion status 2021-03-23 12:25:22 +08:00
component_test.php MDL-71036 phpunit: Renamed various file-related assertions 2021-03-11 19:22:23 +01:00
componentlib_test.php
configonlylib_test.php
content_test.php MDL-69559 course: Add capability and access checks for course download 2020-10-26 10:00:47 +08:00
core_media_player_native.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
core_renderer_template_exploit_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
coverage.php MDL-71036 phpunit: xml config - switch coverage info to new includes 2021-03-11 23:04:32 +01:00
cronlib_test.php
csslib_test.php
csvclass_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
curl_security_helper_test.php MDL-71036 phpunit: Coding style changes, 99% whitespace only 2021-03-11 23:04:32 +01:00
customcontext_test.php MDL-70159 tool_capability: order capabilities by their name. 2021-01-14 07:32:56 +00:00
dataformat_test.php MDL-55971 dataformat: method to write exports to file storage. 2020-08-25 17:28:55 +01:00
datalib_test.php MDL-71186 core_user: show custom user fields in group management screens 2021-04-15 15:28:17 +01:00
datalib_update_with_unique_index_test.php
date_legacy_test.php
date_test.php MDL-68760 string tests: make test_timezone_lang_strings message helpful 2020-05-18 16:51:17 +01:00
editorlib_test.php
encryption_test.php MDL-65818 Security: Encryption API and admin setting for secure data 2020-12-04 14:41:21 +00:00
environment_test.php
event_context_locked_test.php
event_course_module_instance_list_viewed.php
event_course_module_viewed.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
event_deprecated_test.php
event_grade_deleted_test.php
event_profile_field_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
event_test.php MDL-71036 phpunit: Deprecated expectException for notice/warning/error 2021-03-11 19:22:24 +01:00
event_unknown_logged_test.php
event_user_graded_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
event_user_password_updated_test.php
events_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
exporter_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
externallib_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
filelib_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
filestorage_zip_archive_test.php MDL-68137 core_files: replace consecutive dots in filename by single dot 2020-04-28 11:29:35 +02:00
filetypes_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
filter_manager_test.php MDL-71036 phpunit: Coding style changes, 99% whitespace only 2021-03-11 23:04:32 +01:00
filterlib_test.php MDL-71036 phpunit: Coding style changes, 99% whitespace only 2021-03-11 23:04:32 +01:00
formslib_test.php
gdlib_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
gradelib_test.php MDL-68388 core_grades: Tweak unit test assertion to make Oracle happy 2020-05-26 19:00:24 +02:00
grades_externallib_test.php MDL-67306 webservices: Added webservice for Grade category creation 2020-09-03 00:20:44 +02:00
grading_externallib_test.php
grouplib_test.php MDL-71036 phpunit: assertContains() now performs strict comparison 2021-03-11 23:04:31 +01:00
h5p_clean_orphaned_records_task_test.php MDL-66769 core_h5p: Clean up orphaned h5p records task. 2021-02-03 10:10:30 +02:00
h5p_get_content_types_task_test.php MDL-71036 phpunit: Mock->setMethods() silently deprecated 2021-03-11 23:04:31 +01:00
html2text_test.php
html_writer_test.php
htmlpurifier_test.php
indicators_test.php
ip_utils_test.php MDL-67861 libraries: Refactor is_ip_in_subnet_list in ip_utils 2020-03-05 01:28:04 +01:00
jquery_test.php MDL-67673 phpunit: Remove deprecated assertInternalType() 2020-10-21 12:45:59 +02:00
ldaplib_test.php
licenselib_test.php MDL-45184 tool_licenses: Add custom licenses 2020-05-26 12:08:05 +10:00
lock_config_test.php
lock_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
markdown_test.php
mathslib_test.php MDL-67673 phpunit: Remove deprecated assertEquals() params 2020-10-21 12:46:00 +02:00
medialib_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
message_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
messageinbound_test.php
messagelib_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
minify_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
modinfolib_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
moodle_page_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
moodle_url_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
moodlelib_test.php MDL-71099 Lib: Move new user_fields class from core to core_user 2021-03-25 13:47:23 +00:00
mustache_template_finder_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
mustache_template_source_loader_test.php MDL-69553 output: Unit tests for loading multiline string defines 2020-10-21 10:08:54 +01:00
myprofilelib_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
navigationlib_test.php
notification_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
oauth2_test.php MDL-70689 oauth2: unit tests for new IMS OBv2.1 2021-03-12 12:31:24 +01:00
output_mustache_helper_collection_test.php MDL-69050 lang: Stop using the term blacklist in mustache output engine 2020-09-24 19:41:58 +02:00
outputcomponents_test.php MDL-71099 Lib: Move new user_fields class from core to core_user 2021-03-25 13:47:23 +00:00
outputfactories_test.php
outputrequirementslib_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
pdflib_test.php MDL-70735 tcpdf: Reduce information disclosure from TCPDF 2021-02-12 15:41:38 +11:00
persistent_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
plugin_manager_test.php MDL-71036 phpunit: Coding style changes, 99% whitespace only 2021-03-11 23:04:32 +01:00
portfoliolib_test.php MDL-37655 phpunit: Avoid having multiple testcase classes in 1 file 2021-03-30 19:17:54 +02:00
progress_display_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
progress_test.php
qrcode_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
questionlib_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
regex_test.php
requirejs_test.php MDL-67673 phpunit: Remove deprecated assertContains() uses on strings 2020-10-21 12:46:00 +02:00
rsslib_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
rtlcss_test.php
sample_questions.ser
sample_questions.xml
sample_questions_with_old_image_tag.ser
sample_questions_with_old_image_tag.xml
sample_questions_wrong.xml
scheduled_task_test.php Merge branch 'master_MDL-70520' of https://github.com/golenkovm/moodle 2021-01-07 00:17:08 +01:00
scss_test.php
session_manager_test.php MDL-67673 phpunit: Remove deprecated assertEquals() params 2020-10-21 12:46:00 +02:00
session_redis_test.php Merge branch 'MDL-69121-redis-session-store-compression' of git://github.com/jamie-catalyst/moodle into master 2020-11-24 22:58:48 +01:00
sessionlib_test.php
setuplib_test.php MDL-71036 phpunit: Coding style changes, 99% whitespace only 2021-03-11 23:04:32 +01:00
statslib_test.php MDL-67673 phpunit: Move tests to use new phpunit_dataset 2020-10-21 12:46:00 +02:00
string_manager_standard_test.php MDL-69788 lang: fallback to all translations if misconfigured. 2020-10-16 14:33:39 +01:00
tablelib_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
task_database_logger_test.php MDL-66475 task: fix random timing failures in logger cleanup test. 2021-04-04 23:12:57 +01:00
task_logging_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
task_manager_test.php MDL-67483 tasks: Improvements to adhoc task queue at very high scale 2019-12-19 10:49:16 +10:00
task_running_test.php MDL-67211 phpunit: Do not test the order of the running adhoc tasks. 2020-08-27 13:02:36 +10:00
text_test.php
theme_config_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
time_splittings_test.php MDL-67673 phpunit: Remove deprecated assertEquals() params 2020-10-21 12:46:00 +02:00
update_api_test.php
update_checker_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
update_code_manager_test.php MDL-67673 phpunit: Remove expectedException annotations 2020-10-21 12:46:00 +02:00
update_validator_test.php MDL-67673 phpunit: Remove deprecated assertInternalType() 2020-10-21 12:45:59 +02:00
upgrade_util_test.php
upgradelib_test.php MDL-71156 core: machinery to recover orphaned calendar events 2021-04-22 10:28:52 +08:00
user_menu_test.php
user_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
useragent_test.php MDL-67673 phpunit: Fix the return type of template methods 2020-10-21 12:45:59 +02:00
weblib_format_text_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
weblib_test.php MDL-71036 phpunit: Renamed various regexp-related assertions 2021-03-11 19:22:24 +01:00
xhprof_test.php
xhtml_container_stack_test.php
xmlize_test.php