MDL-67673 phpunit: Remove expectedException annotations
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 2 Aug 2020 23:19:50 +0000 (01:19 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 21 Oct 2020 10:46:05 +0000 (12:46 +0200)
commitddf72dd60d7ab37e85f91525ecfd9249328ca0a6
tree99d272c44c751d06e7104e4e2ba0c1700c5bd1c1
parent0ae27225f5f7d5c2c7d4674270671836d9242381
MDL-67673 phpunit: Remove expectedException annotations

While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
59 files changed:
admin/tool/analytics/tests/external_test.php
admin/tool/cohortroles/tests/api_test.php
admin/tool/langimport/tests/events_test.php
admin/tool/monitor/tests/subscription_test.php
admin/tool/uploadcourse/tests/course_test.php
admin/tool/uploadcourse/tests/processor_test.php
analytics/tests/indicator_test.php
backup/converter/moodle1/tests/moodle1_converter_test.php
calendar/tests/externallib_test.php
cohort/tests/cohortlib_test.php
cohort/tests/externallib_test.php
competency/tests/api_test.php
competency/tests/event_test.php
competency/tests/external_test.php
competency/tests/plan_test.php
course/tests/externallib_test.php
enrol/tests/externallib_test.php
grade/grading/tests/grading_manager_test.php
lib/filestorage/tests/file_storage_test.php
lib/filestorage/tests/file_system_filedir_test.php
lib/form/tests/duration_test.php
lib/testing/tests/generator_test.php
lib/tests/admintree_test.php
lib/tests/blocklib_test.php
lib/tests/event_test.php
lib/tests/exporter_test.php
lib/tests/filterlib_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/persistent_test.php
lib/tests/plugin_manager_test.php
lib/tests/update_checker_test.php
lib/tests/update_code_manager_test.php
lib/tests/user_test.php
message/tests/externallib_test.php
mod/assign/tests/externallib_test.php
mod/choice/tests/events_test.php
mod/choice/tests/lib_test.php
mod/forum/tests/events_test.php
mod/glossary/tests/external_test.php
mod/quiz/accessrule/seb/tests/link_generator_test.php
mod/quiz/tests/structure_test.php
mod/scorm/tests/events_test.php
mod/scorm/tests/externallib_test.php
mod/wiki/tests/externallib_test.php
mod/workshop/allocation/random/tests/allocator_test.php
mod/workshop/form/accumulative/tests/lib_test.php
mod/workshop/tests/locallib_test.php
question/behaviour/missing/tests/missingbehaviour_test.php
question/engine/tests/questionattempt_with_steps_test.php
question/engine/tests/questionattemptiterator_test.php
question/engine/tests/questionattemptstepiterator_test.php
question/engine/tests/questionengine_test.php
question/engine/tests/questionutils_test.php
question/type/calculated/tests/variablesubstituter_test.php
question/type/missingtype/tests/missingtype_test.php
user/tests/myprofile_test.php