Compare commits

...

472 Commits

Author SHA1 Message Date
Huong Nguyen c1d466b911 Moodle release 4.4.3 2024-08-30 13:51:03 +07:00
Huong Nguyen 13561f5881 weekly release 4.4.2+ 2024-08-29 18:09:57 +07:00
Paul Holden a31041ef7b MDL-82365 mod_lesson: stricter equality checks of activity password. 2024-08-29 16:12:16 +08:00
Huong Nguyen 098013a01d Merge branch 'MDL-82718-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-29 11:08:46 +07:00
Huong Nguyen ec63b8f289 Merge branch 'MDL-82446-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-29 11:05:14 +07:00
Jun Pataleta b3cea552a2 Merge branch 'MDL-82651-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-08-29 11:59:35 +08:00
Jun Pataleta 9777b29452 Merge branch 'MDL-82802-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-29 11:40:00 +08:00
Ilya Tregubov 081dc58c6f MDL-82882 mod_quiz: Code style fixes 2024-08-29 11:28:03 +08:00
Ilya Tregubov a650045e23 Merge branch 'MDL-82882_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-08-29 11:24:44 +08:00
Huong Nguyen 1396072aa3 MDL-82790 filter_tidy: Fix coding style 2024-08-29 10:19:31 +07:00
Huong Nguyen 8864cfdcb8 Merge branch 'MDL-82790-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-29 10:04:55 +07:00
Ilya Tregubov 727cedf0be Merge branch 'MDL-82810_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-08-29 10:57:13 +08:00
Huong Nguyen d45bc875af Merge branch 'MDL-82898-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-08-29 09:50:14 +07:00
Paul Holden d09d4730d9 MDL-76962 auth_oauth2: users can only delete their own linked logins. 2024-08-29 10:32:16 +08:00
Simey Lameze 57fcc42a49 MDL-82651 behat: remove unnecessary steps 2024-08-28 13:51:24 +08:00
Simey Lameze be680afe3e MDL-82651 behat: wait for button to exist before clicking 2024-08-28 13:51:23 +08:00
Angelia Dela Cruz e1d69f2347 MDL-82898 enrol_self: Behat to test student enrolment using key 2024-08-28 11:34:55 +08:00
Paul Holden c0a69e036e MDL-82718 tiny_media: fix error string loading for invalid image. 2024-08-27 09:21:38 +01:00
Marina Glancy aca6d79b91 MDL-82567 core: Add has_capability method
Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Co-authored-by: Jun Pataleta <jun@moodle.com>
2024-08-26 04:01:20 +00:00
Huong Nguyen a2c405ba5f MDL-69684 session_redis: Improve upgrade note 2024-08-26 10:57:52 +07:00
Huong Nguyen f200548361 MDL-69684 session_redis: Improve PHPUnit test 2024-08-26 10:57:29 +07:00
Huong Nguyen 1ff829a4f0 Merge branch 'MDL-69684-M404_its-possible-to-hold-a-redis-session-lock-forever' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2024-08-26 10:54:10 +07:00
Shamim Rezaie 607cf7fff1 Merge branch 'MDL-82006-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-24 16:21:26 +10:00
Sara Arjona f714dbee87 weekly release 4.4.2+ 2024-08-23 16:03:51 +02:00
Tim Hunt 72ba0759fc MDL-82882 quiz: add before/after for attempt_summary_information 2024-08-23 12:53:37 +01:00
Jake Dallimore 0ada05c99f Merge branch 'MDL-82787-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-23 11:51:23 +08:00
Jake Dallimore a5c0090669 Merge branch 'MDL-82863-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2024-08-23 10:43:37 +08:00
Jun Pataleta 31d7689f7f Merge branch 'MDL-79215-MOODLE_404_STABLE' of https://github.com/MichaelReyesCatcan/moodle into MOODLE_404_STABLE 2024-08-22 23:57:30 +08:00
KarlReyesCatalyst 86a5027502 MDL-79215 lib/graphlib: Typecasting round() function to INT. 2024-08-22 10:20:47 -04:00
Sara Arjona 36002cf5e7 MDL-82863 tool_generator: Add missing BEHAT_TEST constant
The tool_generator now defines the BEHAT_TEST constant to ensure
that Behat generators are consistently utilized.
2024-08-22 13:23:46 +02:00
Huong Nguyen 778a1c3546 Merge branch 'MDL-82841-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-08-22 08:43:37 +07:00
Sara Arjona 19666984de Merge branch 'MDL-82695_404_STABLE' of https://github.com/andrewhancox/moodle into MOODLE_404_STABLE 2024-08-21 16:07:47 +02:00
Sara Arjona 268b9dadfd Merge branch 'MDL-82655-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-08-21 15:54:19 +02:00
Andrew Hancox e3b1909b2b MDL-82695 qtype_multianswer: Fix div by zero in compute_final_grade 2024-08-21 13:47:18 +01:00
Angelia Dela Cruz da1346752d MDL-82841 mod_workshop: Behat for submissions with set # of attachments 2024-08-21 19:00:23 +08:00
Huong Nguyen 50bbd580ac Merge branch 'MDL-82110-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-21 17:43:40 +07:00
Angelia Dela Cruz 6367ed9300 MDL-82655 mod_workshop: Behat test for manual and random allocation 2024-08-21 17:27:14 +08:00
Jun Pataleta 8684982cfe Merge branch 'MDL-78785_404_toolbrickfield_rgbcolorcontrasts' of https://github.com/brickfield/moodle into MOODLE_404_STABLE 2024-08-21 11:49:34 +08:00
Andrew Nicols 59a80f598b MDL-82787 behat: Correct stop of webdriver on failure 2024-08-21 08:46:07 +08:00
Sara Arjona 181f00f36e weekly release 4.4.2+ 2024-08-20 20:15:56 +02:00
Sara Arjona 38aaac7af6 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2024-08-20 20:15:53 +02:00
Andrew Nicols fb7ef63350 MDL-82110 core: Remove debugging for unmigrated hooks in unit tests 2024-08-20 20:28:49 +08:00
Andrew Nicols 2d51edb610 MDL-82790 filter_tidy: Disable the tidy filter
This behaves very poorly and for most users has been silently not
working for many years.

When we stopped it from silently failing we discovered a number of
issues that it causes, for example:
- MDL-61117
- MDL-82790
2024-08-20 20:15:06 +08:00
Sara Arjona 24e196b63d Merge branch 'MDL-82455-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-19 16:45:58 +02:00
AMOS bot 944e9d5fdc Automatically generated installer lang files 2024-08-19 00:07:46 +00:00
Karen Holland b28424638c MDL-78785 tool_brickfield: Processing rgb & rgba color contrasts
Including rgb(), rgba() processing for colour contrast checking.
  Including review requests :void and @covers for phpunit testing.
2024-08-16 17:33:47 +00:00
Tim Hunt d580889967 MDL-82810 question bank: stop action menu from getting truncated 2024-08-16 13:35:50 +01:00
Huong Nguyen d559cde424 weekly release 4.4.2+ 2024-08-16 08:38:37 +07:00
Paul Holden fafeeda7e1 MDL-82455 badges: link report recipients count to appropriate page. 2024-08-15 21:40:41 +01:00
Paul Holden ef70a58aed MDL-82006 reportbuilder: move filter Behat scenarios inside component. 2024-08-15 13:15:26 +01:00
Paul Holden d82ea0f211 MDL-82802 tool_xmldb: allow numeric characters in table names. 2024-08-15 12:00:40 +01:00
Huong Nguyen 96cf22c819 Merge branch 'MDL-82724-MOODLE_404_STABLE' of https://github.com/phmemmel/moodle into MOODLE_404_STABLE 2024-08-15 10:59:48 +07:00
Jun Pataleta 833b48fc75 Merge branch 'MDL-82782-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-15 11:51:57 +08:00
Jun Pataleta a1b390bd4f Merge branch 'MDL-82798-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-08-15 11:13:54 +08:00
Huong Nguyen cc9b202deb Merge branch 'MDL-82758-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-08-15 09:37:47 +07:00
Huong Nguyen f2e657fc42 MDL-82798 qtype_ddmarker: Fix Behat failure 2024-08-15 09:17:13 +07:00
Jun Pataleta d94e170007 Merge branch 'MDL-82792-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2024-08-15 10:14:49 +08:00
Jun Pataleta d430695693 Merge branch 'MDL-82668-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-14 23:26:32 +08:00
Jun Pataleta 36030e92d7 Merge branch 'MDL-82747-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-08-14 23:04:52 +08:00
Daniel Ziegenberg 0d0cdaeecf MDL-69684 session: Redis session locks set with expiry atomically
Co-Authored-By: Jamie Chapman-Brown <jamie.chapman-brown@agilicus.com>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-08-14 17:03:17 +02:00
Andrew Nicols dc9b44f531 MDL-82747 core: Register composer autoload files
Unfortunately PHP does not provide any means to autoload the files that
a functions is located in, even if they are in an namespace.

To work around this, Composer makes use of an `autoload.files` section
in the `composer.json` file. Shortly after the Composer autoloader is
registered with the `spl_autoload_register` call it also includes any
files listed in this section.

Moodle does not do this and really we should be doing so.

This change adds a section to the autoloader registration method which
loads all of the files defined in any third-party library included in
our `lib` directory which contains any `composer.json` file with such a
stanza.
2024-08-14 21:59:53 +08:00
Andrew Nicols 2243d1b395 MDL-82747 core: Provide a standard way to register the Autoloader 2024-08-14 21:59:52 +08:00
Andrew Nicols c0a2c4bfd8 MDL-82782 behat: Support runtime scaling of Behat windows 2024-08-14 21:48:44 +08:00
Sara Arjona 49a95e4cef MDL-82792 h5p: Fix random behat failures
We've started seeing various failures in Firefox and Classic.
Increasing the default window size fixes them.
2024-08-14 12:18:23 +02:00
Andrew Nicols d1d01d2cdb MDL-82668 core: Move phpstorm meta to di.php 2024-08-14 16:32:40 +08:00
Daniil Fajnberg cef371bcac MDL-82668 core: Use a .phpstorm.meta.php directory instead of a file
Allow developers to add their own metadata overrides
2024-08-14 16:32:40 +08:00
Sara Arjona 60dafdf7c1 Merge branch 'mdl-82214-m404' of https://github.com/NeillM/moodle into MOODLE_404_STABLE 2024-08-13 16:08:14 +02:00
Sara Arjona 9e351777b1 Merge branch 'MDL-82502-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-13 13:14:58 +02:00
Ilya Tregubov 0620ca406c Merge branch 'MDL-64675-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-13 10:44:17 +08:00
Ilya Tregubov cc2edf3b8c Moodle release 4.4.2 2024-08-10 14:54:49 +08:00
Jun Pataleta 7376b6deca MDL-82758 gha: Remove reference to the master branch 2024-08-09 16:15:03 +08:00
Jun Pataleta 7052d36f7c Merge branch 'MDL-82599-404-enfix' of https://github.com/mudrd8mz/moodle into MOODLE_404_STABLE 2024-08-09 11:19:01 +08:00
Ilya Tregubov 04479a6a3c weekly release 4.4.1+ 2024-08-09 09:34:20 +08:00
Huong Nguyen 3521b24e51 MDL-82745 filter_tex: Improve PHPUnit test 2024-08-08 21:03:58 +08:00
Michael Hawkins bdfa441f00 MDL-82745 filter_tex: Improve filter deny list 2024-08-08 11:40:11 +07:00
Michael Hawkins 6728d1ccc0 MDL-82576 qtype_calculated: Improve formula regexes 2024-08-08 11:11:28 +07:00
Ilya Tregubov 40d1da51bb Merge branch 'MDL-82608-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 11:09:24 +08:00
Ilya Tregubov c52869afbe Merge branch 'MDL-82605-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 11:03:30 +08:00
Safat 18d4531ad4 MDL-82395 tool_xmldb: Table layout update 2024-08-08 10:00:43 +07:00
Jun Pataleta 62aab40860 Merge branch 'MDL-82560-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-08-08 10:45:01 +08:00
Paul Holden b4525ba984 MDL-79373 admin: ensure all current password configs are defined.
Ensure the admin preset export tool has an accurate record of each,
to be observed as sensitive settings when creating an export.
2024-08-08 09:22:20 +07:00
Angelia Dela Cruz 7b16b52ffe MDL-82560 mod_forum: Test that students can only start one discussion 2024-08-08 10:22:17 +08:00
Andrew Nicols ff93557b40 Merge branch 'MDL-80593-404-alt' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-08-08 10:19:43 +08:00
Huong Nguyen 48e8e6f434 Merge branch 'MDL-82177_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-08-08 09:11:00 +07:00
Huong Nguyen ecc5f367ef Merge branch 'MDL-82592_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-08-08 09:02:09 +07:00
Huong Nguyen 850b4a5f56 Merge branch 'MDL-82669-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 08:58:43 +07:00
Jun Pataleta 91eae783fc Merge branch 'MDL-77784-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 09:56:07 +08:00
Huong Nguyen 912817f097 Merge branch 'mdl-826620-44' of https://github.com/matthewhilton/moodle into MOODLE_404_STABLE 2024-08-08 08:41:25 +07:00
Ilya Tregubov 36412a5fea Merge branch 'MDL-82209-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 09:22:12 +08:00
Ilya Tregubov a7f19c9072 Merge branch 'MDL-82525-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 08:27:15 +08:00
Ilya Tregubov 4bc773ad03 Merge branch 'MDL-82208-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-08 08:18:04 +08:00
Paul Holden cb05767ce1 MDL-64675 mod_feedback: better detection of last page break element.
Inform user when a page break item cannot be added.
2024-08-07 16:57:44 +01:00
Jun Pataleta 4973da2768 Merge branch 'MOODLE_404_MDL-82518' of https://github.com/danielneis/moodle into MOODLE_404_STABLE 2024-08-07 17:12:08 +08:00
Paul Holden aa145e2669 MDL-82633 mod_quiz: filter user visible overrides in external methods. 2024-08-07 16:08:16 +08:00
Paul Holden bdc4367460 MDL-82633 mod_quiz: re-factor visibility check for overrides. 2024-08-07 16:08:16 +08:00
Ilya Tregubov fc467246b4 Merge branch 'MDL-81830-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-07 15:28:02 +08:00
Paul Holden ee502bf6b5 MDL-81394 restore: format backup file metadata details safely. 2024-08-07 14:04:30 +08:00
Ilya Tregubov ee6e605770 MDL-79541 gradereport_user: Fix indentation in Behat. 2024-08-07 04:13:49 +00:00
Huong Nguyen 2d953eb291 MDL-81718 core_grades: Fix Behat failures 2024-08-07 04:13:49 +00:00
raortegar 6e7faf5854 MDL-81718 core: Improve localstorage validation 2024-08-07 04:13:49 +00:00
Paul Holden 50569e6f4a MDL-82558 h5p: escape template error/exception content. 2024-08-07 04:13:49 +00:00
Paul Holden 23a61db0f0 MDL-82392 blocks: consistent cleaning of block instance names. 2024-08-07 04:13:49 +00:00
Paul Holden d3d580671a MDL-82261 mod_feedback: ensure only non-respondents can be messaged. 2024-08-07 04:13:49 +00:00
Paul Holden 8304649791 MDL-82390 badges: correct context check when deleting badges. 2024-08-07 04:13:49 +00:00
meirzamoodle c8c3b17cd2 MDL-82136 curl: Send credentials to redirect URL if allowed
Curl has the option CURLOPT_UNRESTRICTED_AUTH. If true, curl will send
the credentials to a different host. If false, they will not be sent.

CURLOPT_UNRESTRICTED_AUTH can only work if the CURLOPT_FOLLOWLOCATION
option is true. The filelib forces the CURLOPT_FOLLOWLOCATION option
to be false, because all redirects are emulated at the PHP level. So,
in this case, the CURLOPT_UNRESTRICTED_AUTH option is only being used
in our logic and will not work as you might expect it to.

This patch works almost the same as CURLOPT_UNRESTRICTED_AUTH in ideal
conditions. It will check whether the host is different. If so, the
system will check what value CURLOPT_UNRESTRICTED_AUTH has. If it is
not specified, then by default, it will be false. If false, then
credentials will not be sent.
2024-08-07 04:13:49 +00:00
Paul Holden 3e5569a61a MDL-82262 mod_feedback: fix broken bulk message sesskey checks. 2024-08-07 04:13:49 +00:00
Paul Holden 80782f8907 MDL-64984 mod_glossary: capability check when restoring global type. 2024-08-07 04:13:49 +00:00
David Woloszyn 51af50ade5 MDL-81951 communication_matrix: Fix suspended users ignored bug 2024-08-07 04:13:49 +00:00
David Woloszyn b683a38423 MDL-81951 communication_matrix: New trait for power levels
A more reliable way of obtaining room power levels is now used in the
new trait get_room_power_levels_v3. This makes
get_room_powerlevels_from_sync_v3 less needed, but not necessarily
redundant. The names of the containing methods have been adjusted to
make better sense of which trait they belong to.
2024-08-07 04:13:49 +00:00
Ilya Tregubov 54dc1112cb MDL-79541 core_grades: Add missing user info to search services.
Seems just fullname is not enough. So added all name fields.
2024-08-07 04:13:49 +00:00
Ilya Tregubov 421c0608e8 MDL-79541 core_grades: Hidden user fields check for search.
If some user profile fields are hidden on some grade reports
users without permission were able to see those.
2024-08-07 04:13:49 +00:00
Huong Nguyen 7678c3f41c Merge branch 'MDL-82643-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-07 10:45:41 +07:00
Huong Nguyen a3573087d1 Merge branch 'MDL-82611-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-07 10:25:18 +07:00
Huong Nguyen f809e209e3 Merge branch 'MDL-82620-404' of https://github.com/ericmerrill/moodle into MOODLE_404_STABLE 2024-08-07 10:20:38 +07:00
Jun Pataleta 59a377abbe Merge branch 'MDL-82606_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-08-07 11:12:05 +08:00
Philipp Memmel ac7cecfb37 MDL-82724 editor_tiny: Harden check for quicktoolbar and contextmenu 2024-08-06 16:47:22 +02:00
Tim Hunt 83a24b0e9f MDL-82606 filterlib: pass a row limit to recordset for performance
On Postgres, at least, get_recordset_sql performs signficantly worse
if you don't pass a limit. So, we add a limit to the query, but one
that in enormously too large, so it should never have an effect.
(And, there is code to check we never hit the limit, to avoid subtle bugs.)
2024-08-06 10:47:24 +01:00
Jun Pataleta 7ffbd04d35 Merge branch 'MDL-82344-404' of https://github.com/snake/moodle into MOODLE_404_STABLE 2024-08-06 17:26:44 +08:00
Jun Pataleta 19284518d1 Merge branch 'MDL-79568-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-08-06 17:20:26 +08:00
Neill Magill cb8578e93f MDL-82214 admin: Settings should not change when in read only mode
Before this change if some settings were:

* read only
* visible on a settings page
* are set or have values selected

when the settings page was saved the setting would be set tobe empty,
because the hidden input remained on the page, while the other inputs
where not posted to Moodle.
2024-08-06 09:53:34 +01:00
Paul Holden 217f5d8f8d MDL-82446 files: pleasantly style the filepicker modal containers. 2024-08-05 08:40:35 +01:00
Paul Holden dec2143d73 MDL-79568 javascript: remove lang parameter from legacy string calls. 2024-08-05 08:33:19 +01:00
Ilya Tregubov abd4203547 Merge branch 'MDL-82171-muc-sited-MOODLE_404_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_404_STABLE 2024-08-05 11:18:59 +08:00
Shamim Rezaie 28922ba889 Merge branch 'MDL-82384-MOODLE_404_STABLE' of https://github.com/jwcatau/moodle into MOODLE_404_STABLE 2024-08-03 23:55:36 +10:00
Daniel Neis Araujo b67fb190b9 MDL-82518 core_user: Fix regression introduced by MDL-80271 2024-08-02 14:46:51 -03:00
David Mudrák 1e0f46a125 MDL-82599 lang: Use the fixed strings in tests, too 2024-08-02 17:44:42 +02:00
Helen Foster 1abeac9ba4 MDL-82599 lang: Import fixed English strings (en_fix) 2024-08-02 17:42:52 +02:00
Paul Holden 84c134f7c0 MDL-82669 mod_assign: remove Atto reliance workaround for Behat.
See 8fe80e743c for context, and 802ff3e2e3 for additonal comments.
2024-08-02 10:33:34 +01:00
Paul Holden aa8f7a6a39 MDL-82669 editor: remove reliance on Atto editor in Behat scenarios. 2024-08-02 10:33:34 +01:00
Paul Holden 2937e90bc7 MDL-82502 courseformat: align module action capability checks.
The "Hide/Show/Duplicate" actions should be considered self-contained,
and not also require "manageactivities" capability (per existing docs)
in addition to the specific capability that controls the action itself.

Also ensure the "Duplicate" capability checks are in the course context.
2024-08-02 10:01:16 +01:00
Paul Holden 01971bc9a4 MDL-82608 mod_data: null content checks when editing fields. 2024-08-02 09:57:37 +01:00
Paul Holden 09fae09cd5 MDL-82605 contentbank: pre-load contexts for options list.
Prevents additional DB reads per category/course, which can be
potentially expensive on large sites.
2024-08-02 09:50:17 +01:00
Ilya Tregubov e0381615aa weekly release 4.4.1+ 2024-08-02 09:30:45 +08:00
Ilya Tregubov 349916ae5f Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2024-08-02 09:30:42 +08:00
Matthew Hilton 5168d9c97b MDL-82662 login: load library with require_once 2024-08-02 10:52:57 +10:00
Paul Holden fc38c5c7e7 MDL-77784 quiz_grading: editor agnostic Behat scenario steps. 2024-08-01 14:17:15 +01:00
James Williams 3ab8986eb0 MDL-82384 core: Alter logic to only purge muc OR course caches. 2024-08-01 18:53:18 +10:00
Huong Nguyen be4d15a856 Merge branch 'MDL-80064-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-08-01 10:41:43 +07:00
Huong Nguyen 495f38ff3f Merge branch 'MDL-82598-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-08-01 10:26:52 +07:00
Huong Nguyen 0fe19ee1dc MDL-80593 core: Make Modal to work with Debug Template Info mode 2024-08-01 10:18:18 +07:00
Huong Nguyen ef3d7a9d18 MDL-80017 core_grades: Move upgrade note 2024-08-01 09:15:26 +07:00
Huong Nguyen 1970d836c6 Merge branch 'MDL-80017-404' of https://github.com/jleyva/moodle into MOODLE_404_STABLE 2024-08-01 09:12:12 +07:00
Ilya Tregubov 96f76208d1 Merge branch 'MDL-81689_MOODLE_404_STABLE' of https://github.com/rzhtwberlin/moodle into MOODLE_404_STABLE 2024-08-01 09:59:26 +08:00
Jun Pataleta 2fb409a999 Merge branch 'MDL-82286-404' of https://github.com/daledavies/moodle into MOODLE_404_STABLE 2024-08-01 09:47:11 +08:00
AMOS bot 86afac09e9 Automatically generated installer lang files 2024-08-01 00:07:35 +00:00
Sara Arjona 45fbccf625 Merge branch 'MDL-72876-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-31 17:15:19 +02:00
Sara Arjona 2c2cda1660 Merge branch 'MDL-82397-404' of https://github.com/lucaboesch/moodle into MOODLE_404_STABLE 2024-07-31 16:59:27 +02:00
Sara Arjona e6176d6dba Merge branch 'MDL-82596-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-31 16:46:06 +02:00
Dale Davies 0be064b328 MDL-82286 quiz_accessrule: Add SEB config test for floating point number
This tests several variations of SEB config files, to ensure Moodle
is able to parse them and generate a config key hash that matches
what SEB expects.

Additional values have been added to the unencrypted_win_233.seb
config file to cover the existence of floating point values,
ensuring they are serialized correctly. The config hash value
has been updated in real_ck_hash_provider to reflect the change.

Also added coverage information to the test case class docblock.
2024-07-31 11:17:26 +01:00
Jun Pataleta 5b68c82eb2 Merge branch 'MDL-82187-single-button-404' of https://github.com/djarran/moodle into MOODLE_404_STABLE 2024-07-31 17:21:32 +08:00
Paul Holden 94bcaa0d4f MDL-82208 block_starredcourses: avoid double encoding course name. 2024-07-31 08:47:23 +01:00
Simey Lameze 971b7b6eb7 MDL-82598 behat: improve example submission test 2024-07-31 09:05:07 +08:00
AMOS bot ad698059ae Automatically generated installer lang files 2024-07-31 00:07:32 +00:00
Paul Holden 1114ab3822 MDL-82643 enrol_self: clarify validation of notification threshold. 2024-07-30 15:48:07 +01:00
Tim Hunt adf336cbf2 MDL-82177 file upload: default to path '/'when things go wrong
This 'fix' is basically a work-around, but one that is already used in
some places. Now it is used in all similar places.

Exactly what causes the current file path in a file manager to become
unset is still unclear to me, but it seems to be an obscure race
condition that is very hard to reproduce.

However, when it happens, currently we are effectively defaulting to
path '/undefined/'. Using '/' is never worse, and is infinitely better
in the case where the filepicker does not allow folders to be used
(which includes important cases like essay questions in a quiz, which
some people use for exams!). In that case, falling back to non-top-level
path leads to dataloss.

Also, this is all historic JavaScript which will get replaced in the
grand de-YUI-fication, so I think a pragmatic fix is justified here.
2024-07-30 15:07:02 +01:00
Jun Pataleta b150085bb1 MDL-72876 theme_classic: Enclose welcome message in Bootstrap card 2024-07-30 19:40:21 +08:00
meirzamoodle f0dd2ae1f5 MDL-80064 authentication: password can be null
The Open ID Connect plugin uses null for the password,
which makes the internal password update fail to proceed.
Allowing null resolved the problem.

As a note, there is a potential issue if the authentication method has
a false return for the prevent_local_password because it will trigger
the hash_internal_user_password() where  the $password can not be null.
Since this only addresses the oauth2 issue, we should ignore it.
2024-07-29 15:50:08 +07:00
Paul Holden fd63451ecc MDL-82525 user: correct course parameter for course profile page. 2024-07-29 09:22:03 +01:00
Paul Holden 3d40c9bc47 MDL-81830 calendar: handle clearing of group type course element. 2024-07-29 09:20:49 +01:00
Paul Holden b540ab944c MDL-82209 calendar: consistent event action icon hovering.
* Apply hover on the icons, rather than the outer container;
* Make hover colour and text decoration appropriate for the icon
2024-07-29 09:19:35 +01:00
Jake Dallimore d34d87f45a MDL-82344 mod_lti: relax content selection validation in instance form
This was added in MDL-78916 in 4.3 but makes configuring a generic
launch to the default tool URL impossible, since a content item must be
selected. This fix:
- Makes this element optional again, which allows teachers to choose
whether a given instance launches into selected content, or launches
the default tool URL.
- Changes the style to btn-secondary, given it's now optional again
2024-07-29 13:06:11 +08:00
Andrew Nicols abd665d545 Merge branch 'MDL-82250-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-07-29 11:47:56 +08:00
Ilya Tregubov 5bcdefb516 Merge branch 'MDL-80345-404' of https://github.com/MartinGauk/moodle into MOODLE_404_STABLE 2024-07-29 11:33:22 +08:00
Paul Holden d69212b895 MDL-82596 behat: switch manual private files upload to generator. 2024-07-28 19:16:57 +01:00
Paul Holden 0223b0fefb MDL-82596 behat: tidy up existing usage of private files generator.
Filename is no longer required (since 83db25c330), given it never
did anything so can be removed. Requiring the "Private files" block
also isn't necessary since original switch to generator methods.
2024-07-28 19:13:39 +01:00
Paul Holden 3452312c8c MDL-82611 mod_assign: capability check before exporting grade link. 2024-07-26 21:20:40 +01:00
Eric Merrill e884c04350 MDL-82620 completion: Make enrol duration comp happen at the right time 2024-07-26 14:11:53 -04:00
Luca Bösch a1dcb85347 MDL-82397 block_recentlyaccesseditems: Assure space between items. 2024-07-26 18:23:48 +02:00
Tim Hunt ed179a8d7f MDL-82592 quiz grades: 'setup for sections' handling of descriptions 2024-07-26 13:07:21 +01:00
Johannes Burk 30bae49637 MDL-81689 tests: Check task DB record for nextruntime 2024-07-26 10:36:29 +02:00
Johannes Burk 0ae247b51f MDL-81689 tasks: add unit test to check for the bug 2024-07-26 10:36:29 +02:00
Jun Pataleta d8a1a67fd7 weekly release 4.4.1+ 2024-07-26 13:35:36 +08:00
Jun Pataleta acbfa5e1a3 NOBUG: Fixed SVG browser compatibility 2024-07-26 13:35:34 +08:00
Jun Pataleta 408154a1b6 Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2024-07-26 13:35:33 +08:00
Jun Pataleta f91d479407 Merge branch 'MDL-82373-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-26 13:20:45 +08:00
Andrew Nicols 09b9c2a5b9 MDL-82373 core_message: Make message drawer router behat-aware
The drawer router was modifying the DOM in a variety of ways and hiding
content, without any pendingJS checks. As a result, there were cases
where a part of the UI was not visible, but had been rendered and was in
the DOM.

This change wraps the router Go method in a pendingJS call that only
resolves when the router transition completes.

Additionally the lazy load manager had a similar issue.
2024-07-26 12:45:30 +08:00
Juan Leyva 8d12c2a15e MDL-80017 core_grades: Fix return type for itemname 2024-07-25 11:16:52 +02:00
Huong Nguyen a358040701 Merge branch 'MDL-82527-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-25 10:48:50 +07:00
Huong Nguyen a03674de6f Merge branch 'MDL-82530-spelling-404' of https://github.com/leonstr/moodle into MOODLE_404_STABLE 2024-07-25 10:41:38 +07:00
Huong Nguyen b3dbeeecf7 Merge branch 'MDL-82328-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-25 10:36:01 +07:00
Jun Pataleta e18333d842 Merge branch 'MDL-82373-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-25 11:31:43 +08:00
Huong Nguyen 67b21bbc99 Merge branch 'MDL-58287-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-25 10:29:43 +07:00
Jun Pataleta d81770cdbe Merge branch 'MDL-77706-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-25 11:02:46 +08:00
Huong Nguyen 688ee9e9d1 Merge branch 'MDL-82553-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-25 09:17:26 +07:00
Shamim Rezaie 42cc612a5e Merge branch 'MDL-82540-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-25 12:07:24 +10:00
Shamim Rezaie fa8b74b5eb Merge branch 'MDL-82551-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-25 11:52:59 +10:00
Huong Nguyen ffc32f80a5 Merge branch 'MDL-82554-MOODLE_404_STABLE' of https://github.com/micaherne/moodle into MOODLE_404_STABLE 2024-07-25 08:50:32 +07:00
Huong Nguyen 3da6a04461 Merge branch 'MDL-82451-404' of https://github.com/aanabit/moodle into MOODLE_404_STABLE 2024-07-25 08:43:49 +07:00
Huong Nguyen eac19ef151 Merge branch 'MDL-82422-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-07-25 08:36:46 +07:00
AMOS bot 37a95f12e7 Automatically generated installer lang files 2024-07-25 00:08:08 +00:00
Amaia Anabitarte 727c4c5a6e MDL-82451 course: Switch hide/show icons for section action menu 2024-07-24 12:17:45 +02:00
Jun Pataleta a52f92a82c Merge branch 'MDL-81803-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-24 16:57:50 +08:00
Jun Pataleta 067818c2e6 Merge branch 'MDL-82289-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-24 15:05:32 +08:00
Angelia Dela Cruz d7d19fe136 MDL-82422 mod_workshop: Behat for how strict assessment comparison is 2024-07-24 13:44:36 +08:00
Huong Nguyen 28a7d39b2a Merge branch 'MDL-82528-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-24 12:00:09 +07:00
Michael Aherne da95f8d083 MDL-82554 question: Allow null createdby in question_has_capability_on. 2024-07-23 10:47:07 +01:00
Simey Lameze b1297a80df MDL-82250 core: add web installer test workflow 2024-07-23 13:33:03 +08:00
Jun Pataleta cbafc55078 MDL-82553 behat: Run accessibility tests using WCAG 2.2 success criteria 2024-07-22 14:37:49 +08:00
Jun Pataleta b7bd55bc82 MDL-82551 core: Set welcome message heading to level 1 2024-07-22 14:21:02 +08:00
Huong Nguyen aafb937adf Merge branch 'MDL-82481-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-22 10:40:44 +07:00
Huong Nguyen 95d011dcf1 Merge branch 'MDL-82193-404' of https://github.com/ericmerrill/moodle into MOODLE_404_STABLE 2024-07-22 09:39:46 +07:00
Ilya Tregubov c930111e17 Merge branch 'MDL-82499-MOODLE_404_STABLE' of https://github.com/micaherne/moodle into MOODLE_404_STABLE 2024-07-22 09:42:53 +08:00
djarrancotleanu f0c5d668e9 MDL-82187 core: Add default type for single button in template 2024-07-22 08:48:26 +10:00
AMOS bot a061f1b4c2 Automatically generated installer lang files 2024-07-21 00:07:43 +00:00
Paul Holden 2299b73307 MDL-58287 courseformat: ensure all format plugins are returned. 2024-07-19 15:23:37 +01:00
Paul Holden 85c7dcaf05 MDL-82528 courseformat: switch to existing group action icon.
Use a version that already exists in our fontawesome mapping so it
can be consistently styled/overridden.
2024-07-19 12:54:42 +01:00
Sara Arjona 8d30ff7575 Merge branch 'MDL-81119-forced-config-MOODLE_404_STABLE' of https://github.com/bwalkerl/moodle into MOODLE_404_STABLE 2024-07-19 12:37:16 +02:00
Jun Pataleta 2e8bf841c6 MDL-82540 core: Use an empty check for $CFG->debugdisplay 2024-07-19 16:25:12 +08:00
Benjamin Walker d5b719f6a0 MDL-81119 tool_recyclebin: Stop overriding unrelated forced config 2024-07-19 14:37:23 +10:00
Ilya Tregubov d7cb2a66cd weekly release 4.4.1+ 2024-07-19 09:30:25 +08:00
Leon Stringer e96db7beec MDL-82530 core: Fix spelling 2024-07-18 14:51:00 +01:00
Paul Holden 44801c448c MDL-82481 customfield_select: return field options pre-formatted. 2024-07-18 14:03:18 +01:00
Paul Holden 904222b6f2 MDL-82481 reportbuilder: re-use existing method for field options. 2024-07-18 14:03:18 +01:00
Paul Holden f1bc96a8ab MDL-82527 h5p: improve editor Behat scenarios for embedding content.
* Move the shared drag fixture out of the Atto plugin;
* Switch to using faster generators for populating private files;
* Clarify required fields for private files generator
2024-07-18 09:37:47 +01:00
Jun Pataleta d0ce8e8d62 Merge branch 'MDL-82505-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-18 12:50:57 +08:00
Jun Pataleta c2f3e98cea Merge branch 'MDL-75864-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-07-18 12:47:50 +08:00
Huong Nguyen 266c8b73b0 MDL-82505 calendar: more precise matching of calendar day partial
The partial name selector points to the parent element,
but the Javascript code monitors the child element.
We need to make it consistent
2024-07-18 11:37:07 +07:00
Andrew Nicols 00ce502c67 Merge branch 'MDL-82309-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-18 11:58:45 +08:00
Ilya Tregubov 38ab94e04b Merge branch 'MDL-82445-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-18 11:37:02 +08:00
Andrew Nicols dc6db54e99 Merge branch 'MDL-81932-404' of https://github.com/safatshahin/moodle into MOODLE_404_STABLE 2024-07-18 11:29:01 +08:00
Huong Nguyen d45422ccbf Merge branch 'MDL-82192-404' of https://github.com/ericmerrill/moodle into MOODLE_404_STABLE 2024-07-18 10:27:17 +07:00
Andrew Nicols c1b4d24095 Merge branch 'MDL-81272-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-18 11:22:10 +08:00
Andrew Nicols e05fa63684 MDL-82445 filter_tidy: Ensure locale does not change when using Tidy 2024-07-18 11:00:42 +08:00
Andrew Nicols 03f840b4f2 MDL-82445 core: Create locale helper utility 2024-07-18 11:00:42 +08:00
Ilya Tregubov fbd674e81b Merge branch 'MDL-82090-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-18 10:39:49 +08:00
Ilya Tregubov 1291503846 Merge branch 'MDL-82444-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-18 10:32:55 +08:00
Huong Nguyen 21fc6a3016 Merge branch 'MDL-82467-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-18 09:19:51 +07:00
Sara Arjona 23f0ec2766 Merge branch 'MDL-82353-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-07-17 17:07:53 +02:00
Paul Holden b99a81af8e MDL-82499 question: test for invalid question in capability check. 2024-07-17 09:57:42 +01:00
Andrew Nicols 908488e472 MDL-82373 contentbank: Pause in Behat before interacting with h5p
It seems that the loading of the h5p content upsets other interactions
with the page in Firefox as it loads. Unfortunately I haven't found a
reliable way to handle this with pendingJS yet.

This is the poor man's fix and we should find a better solution.
2024-07-17 13:28:57 +08:00
Andrew Nicols 7fdb644bd1 MDL-82373 question: Make window larger in behat tests
I would suggest that this is a stop gap to solve some failing tests. We
really need to look at whether we can improve the usability of this
interface on smaller displays as a longer-term fix.
2024-07-17 13:28:56 +08:00
Andrew Nicols 70204fd73c MDL-82373 core_grades: Address random failures when editing gradebook 2024-07-17 13:28:56 +08:00
Andrew Nicols 389e4fc011 MDL-82373 behat: Wait for alerts before accepting/dismissing them 2024-07-17 13:28:56 +08:00
Andrew Nicols ed4a47302e MDL-82373 core: Make CollapsibleRegion more tolerant to behat 2024-07-17 13:28:55 +08:00
Andrew Nicols 0f0710a249 MDL-82373 tool_usertours: Ensure that behat waits for tours to show/hide 2024-07-17 13:28:55 +08:00
Andrew Nicols 42511349ae MDL-82373 behat: Stop killing the entire Behat run on driver error
If there's a driver error, for example from a step taking too long, then
this kills the entire Behat run and we have to start from scratch.

This change instead throws away the original connection and starts a new
one to try and continue the test.
2024-07-17 13:28:55 +08:00
Andrew Nicols 32f1542b5e MDL-82373 behat: Stop calling ensure_node_is_visible before click
W3C WebDriver Element::Click, Element::Clear, and Element::SendKeys all
state that the WebDriver implementation (chromedriver, geckodriver,
edgedriver) should scroll the element into view if it is not already
visible.

It is wrong for us to check if the element is visible or not before
calling these as it may not be but will during the click/clear/type
event.
2024-07-17 13:28:55 +08:00
Andrew Nicols 78bcf355c6 MDL-82373 mod_lesson: Fix failing behat tests for Selenium 4
Recent versions of Chrome do not re-render the page but return previous
page state from cache. The page state had the Submit button disabled
before navigating away.

Refreshing the page addresses this.
2024-07-17 13:28:54 +08:00
Brendan Heywood 31e0fd81a7 MDL-82171 core: Rewarm bootstrap.php after a cache purge 2024-07-17 15:16:12 +10:00
Ilya Tregubov 7a21be49f9 Merge branch 'MDL-82002-404' of https://github.com/durenadev/moodle into MOODLE_404_STABLE 2024-07-17 11:04:55 +08:00
Michael Aherne 43b3bda115 MDL-82499 question: Fail if questionid does not exist. 2024-07-16 14:59:55 +01:00
Dale Davies 088c523df0 MDL-82286 core: Set serialize_precision to current PHP default 2024-07-16 10:01:57 +01:00
Angelia Dela Cruz 4af5185587 MDL-82353 gradingform: Behat to verify marking guide can be set to draft 2024-07-16 16:46:51 +08:00
Andrew Nicols b2018b2fbc MDL-77706 atto_link: Work around Mozilla bug 1906559
This upstream bug prevents creation of an anchor with a hyperlink where
the content has a block-like display.

The workaround is to wrap the content in a span, set the display to
inline, call the `createLink` command on the span, move the content out
of the span, and then remove it.

This is only done for Firefox-based browsers.
2024-07-16 15:37:46 +08:00
Ilya Tregubov 25f4874743 Merge branch 'MDL-82282-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-16 09:26:20 +08:00
Ilya Tregubov 3ff165b4c5 Merge branch 'MDL-82319-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-07-16 09:21:58 +08:00
Ilya Tregubov 1d51af0f8e Merge branch 'MDL-73662-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-16 09:15:50 +08:00
Paul Holden aa550ddea6 MDL-82467 completion: simplify field SQL for completion columns.
For columns whose values can be represented purely in SQL, we don't
need to/shouldn't select extra data because it confuses the column
output during aggregation for numeric/boolean columns.
2024-07-15 13:34:55 +01:00
Huong Nguyen 978ada1047 MDL-81272 calendar: Improve permission check for separate group mode 2024-07-15 15:46:55 +07:00
Andrew Nicols 8b7270f9b1 MDL-66903 core: Check PHPUNIT_TEST defined before using 2024-07-15 13:45:36 +07:00
Huong Nguyen 8741181a5b Merge branch 'MDL-66903-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-15 13:22:02 +07:00
Laurent David e7065ad471 MDL-82319 core_courseformat: Remove redundant lock icon in section 2024-07-15 06:33:31 +02:00
Andrew Nicols d36cf65ef3 MDL-66903 core: Introduce \core_component::reset to replace hacks
Traditionally we have done this using reflection and it would be better
to do this in a 'proper' fashion in case we ever need to change how it
works.
2024-07-15 12:22:19 +08:00
Andrew Nicols 39d46917bb MDL-66903 testing: Helper to load fixture files 2024-07-15 12:22:17 +08:00
Andrew Nicols 6b3d8fd889 MDL-66903 testing: Add support for a \tests\ namespace during tests
This commit:
- introduces a \tests\ sub-namespace for use in unit tests only
- the path to this the tests/classes directory of the owning parent
- files here are excluded from unit test runs

This is agreed per policy in MDL-80855.
2024-07-15 12:21:54 +08:00
Andrew Nicols b15b73848a MDL-66903 testing: Fix whitespace 2024-07-15 12:21:06 +08:00
Andrew Nicols 6cd08cc382 MDL-66903 testing: Reset CFG and component after test
This change moves the reset of global test state to the finally section
rather than doing it only if the test passes.

Previously if a test which modifies the `core_component` internals
failed, it would not reset the internal state and impact subsequent
tests.
2024-07-15 12:21:06 +08:00
Eric Merrill b1a6791aa2 MDL-82193 scorm: Don't store header with multiline AICC content 2024-07-12 15:35:35 -04:00
Paul Holden 384300011c MDL-82444 core: skip environment test on optional plugin extensions. 2024-07-12 13:49:54 +01:00
Paul Holden 57fc94747d MDL-82444 filter_tidy: advertise required PHP extension. 2024-07-12 13:34:06 +01:00
Paul Holden 9956e9ff31 MDL-73662 mod_quiz: fix initialization arguments to close button.
Co-authored-by: Sergio Rabellino <rabellino@di.unito.it>
2024-07-12 13:18:10 +01:00
Paul Holden 8601c56964 MDL-81803 tool_dataprivacy: observe disabled expiration time.
A non-positive integer value should indicate "No time limit".
2024-07-12 11:04:59 +01:00
Daniel Ureña 9f1ab61160 MDL-82002 Media: Video embedding from the app is styled properly. 2024-07-12 11:22:07 +02:00
Huong Nguyen 4197e50fec weekly release 4.4.1+ 2024-07-12 08:42:06 +07:00
Huong Nguyen 23ba4d1792 Merge branch 'MDL-82245-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 11:14:07 +07:00
Jun Pataleta 17e5aaa5be Merge branch 'MDL-81265-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-11 12:08:52 +08:00
Jun Pataleta dd998e8d88 MDL-81265 mod_workshop: Verify "Setup phase" heading with "should exist" 2024-07-11 11:58:39 +08:00
Laurent David 1bfd61c0fd MDL-81265 mod_workshop: Fix accessibility issues
* Page title should be h2
* Contrasts in the table headers (for submission, assessment and grading)
should be 4:1 at least
2024-07-11 11:58:39 +08:00
Andrew Nicols 95274afe55 Merge branch 'MDL-78936-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-11 11:53:21 +08:00
Andrew Nicols 8d1bf9d92d Merge branch 'MDL-82431-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 11:46:26 +08:00
Huong Nguyen 799e5c9ecc Merge branch 'MDL-79717-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 09:35:15 +07:00
Huong Nguyen 1d20be4c3d Merge branch 'MDL-76654-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-07-11 09:19:40 +07:00
Paul Holden ed5fde9c1f MDL-82431 phpunit: correct unit test filename and classname.
Standardise the same test cases, e.g. make final, covers notation,
static data providers, namespaces, etc.

Once the tests run, a couple of them failed. They required changes
to assertions to make them pass.
2024-07-10 19:06:17 +01:00
Sara Arjona 45d839a7c8 Merge branch 'MDL-82391-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-10 18:05:53 +02:00
Jun Pataleta 0ebbf88990 Merge branch 'MDL-82417-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2024-07-10 22:16:11 +08:00
Paul Holden 2196813e1e MDL-79717 phpunit: ensure unique data provider keys in tests.
Duplicate data provider keys were overwriting and/or duplicating
one another, leading to some cases being skipped.

Other "duplicate array key" errors were picked up by `phpcs` in
this dragnet across all tests, which have also been fixed.
2024-07-10 14:08:52 +01:00
Huong Nguyen 562b9775b2 Merge branch 'MDL-82308_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-07-10 14:57:24 +07:00
Ilya Tregubov cbe78bb3a6 Merge branch 'MDL-82323-striptags_error-404' of https://github.com/leonstr/moodle into MOODLE_404_STABLE 2024-07-10 12:18:40 +08:00
Huong Nguyen 8cfc9387f2 Merge branch 'MDL-68211-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2024-07-10 09:07:49 +07:00
Huong Nguyen 0ea950e710 Merge branch 'MDL-82236-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-07-10 09:04:14 +07:00
Tim Hunt 077f535912 MDL-82401 quiz: editing modals must be removed on close 2024-07-10 08:58:13 +07:00
Sara Arjona e1816e9af1 Merge branch 'MDL-81349-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-09 18:14:44 +02:00
Paul Holden 5ca387bef3 MDL-82391 courseformat: correct selector element section URLs.
It's required by themes that don't use the course index component,
e.g. Classic theme.
2024-07-09 14:45:22 +01:00
Sara Arjona 27cd5596e7 Merge branch 'MDL-82360-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-09 15:30:14 +02:00
Sara Arjona a10c074f54 Merge branch 'MDL-77834-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-09 15:22:13 +02:00
Sara Arjona ba80f884f7 Merge branch 'MDL-81991-404-alt' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-09 13:07:47 +02:00
Sara Arjona 54ec6416b4 Merge branch 'MDL-78388-404' of https://github.com/djarran/moodle into MOODLE_404_STABLE 2024-07-09 11:47:34 +02:00
Sara Arjona 83bec3bdb5 Merge branch 'MDL-66251-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-07-09 10:36:36 +02:00
Paul Holden 8a325684d0 MDL-82309 comment: preserve link text property during AJAX requests.
We really only need to update the count value that follows the link
text content, so do that rather than overwriting the entire thing.
2024-07-09 09:17:17 +01:00
Sara Arjona 8704a69aed Merge branch 'MDL-80947-404' of https://github.com/stevandoMoodle/moodle into MOODLE_404_STABLE 2024-07-09 10:03:09 +02:00
Sara Arjona d6fbf5661a Merge branch 'MDL-82310-404' of https://github.com/ferranrecio/moodle into MOODLE_404_STABLE 2024-07-09 08:54:54 +02:00
Angelia Dela Cruz 6a33cb3e08 MDL-82236 mod_data: Behat to display DB activity entry rating 2024-07-09 14:53:06 +08:00
Sara Arjona cd2d47dafc Merge branch 'MDL-81296-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-07-09 08:50:36 +02:00
David Woloszyn 1be7820208 MDL-82417 admin: Clarify signoutofotherservices strings 2024-07-09 13:58:14 +10:00
Angelia Dela Cruz f297094295 MDL-81296 mod_data: Behat test for data activity readonly availability 2024-07-09 11:38:35 +08:00
Paul Holden 0aeff04c0a MDL-82328 auth_oauth2: don't load custom profile field data too early.
By prematurely loading custom profile data in the constructor, under
specific circumstances it would happen before the page was fully
initialised which meant that any attempt at applying filters when
formatting profile field data would result in thrown exception.
2024-07-08 08:55:55 +01:00
Simey Lameze 959963e1e4 MDL-76654 behat: fixes and improvements to self assessment test 2024-07-08 11:22:08 +08:00
Angelia Dela Cruz 7acefc469c MDL-76654 behat: Coverage for workshop self-assessment 2024-07-08 11:22:08 +08:00
meirzamoodle 3ae349b86e MDL-66251 form: Hiding and disabling static elements.
Added functionality to locate static text elements within the form,
improving the ability to target and manipulate the static elements for
hiding and disabling purposes.
2024-07-08 09:17:26 +07:00
Stevani Andolo 3413c90bd2 MDL-80947 communication_customlink: Check before customlink update 2024-07-08 07:21:15 +08:00
Sara Arjona 41a5833327 MDL-68211 feedback: Export percentage format
The feedback was exporting the percentage in the Analysis file using
a wrong value for the format, so instead of having only 2 decimals,
the number was not formatted.
2024-07-05 10:13:46 +02:00
Ilya Tregubov 9557a52569 weekly release 4.4.1+ 2024-07-05 09:02:00 +08:00
Huong Nguyen f41181c894 Merge branch 'MDL-80907-404-take-2' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-04 21:43:53 +07:00
Huong Nguyen ff3fb00a96 MDL-80907 qtype_ordering: Fix incorrect Behat column selectors 2024-07-04 21:24:12 +07:00
Paul Holden 7f45da44ed MDL-82289 mod_feedback: correct comparison of current $course. 2024-07-04 10:28:49 +01:00
Sara Arjona d9a761f6ee Merge branch 'MDL-80907-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-04 11:19:45 +02:00
Paul Holden 771694018e MDL-82282 question: consider only editable flags in JS module. 2024-07-04 10:19:30 +01:00
Paul Holden eafd1bcb17 MDL-82090 completion: account for alternate gradepass form fields.
Some modules (e.g. Workshop) have "*gradepass" fields for each grade
item, which should be accounted for when trying to freeze them.
2024-07-04 10:17:34 +01:00
Huong Nguyen 7065a3dca0 MDL-80907 behat: Fix incorrect column selectors 2024-07-04 15:16:45 +07:00
Safat 5bc2479793 MDL-81932 communication_customlink: Fix behat tests 2024-07-04 17:10:19 +10:00
Safat 70d257fc5b MDL-81932 communication_matrix: Fix behat tests 2024-07-04 17:10:19 +10:00
Safat 3423dd2245 MDL-81932 core_communication: Fix communication provider change issue 2024-07-04 17:10:19 +10:00
Huong Nguyen a0a2015027 Merge branch 'MDL-80907-404' of https://github.com/marinaglancy/moodle into MOODLE_404_STABLE 2024-07-04 11:13:38 +07:00
Ilya Tregubov 96f2686d47 Merge branch 'MDL-63670-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-07-04 10:57:37 +08:00
Ilya Tregubov 5bbd628f49 Merge branch 'MDL-82315-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-04 10:39:02 +08:00
Ilya Tregubov aad75c1072 Merge branch 'MDL-82024-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-04 09:50:53 +08:00
ferranrecio c35610502f MDL-82310 backup: fix delegated section restore 2024-07-03 18:26:01 +02:00
Sara Arjona f35b8e6651 Merge branch 'MDL-82100-404' of https://github.com/danghieu1407/moodle into MOODLE_404_STABLE 2024-07-03 17:14:17 +02:00
Jun Pataleta 5be8cf7ba8 Merge branch 'MDL-31192-M404_colored-box-with-pre-tag-function-generates-a-warning' of https://github.com/ziegenberg/moodle into MOODLE_404_STABLE 2024-07-03 15:13:04 +08:00
Hieu Nguyen Dang b3b8f520e9 MDL-82100 Quiz\report: Show customised question numbers 2024-07-03 13:48:49 +07:00
Sara Arjona a25eb4cb95 Merge branch 'MDL-82363-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-07-03 08:23:43 +02:00
lameze f4f7f83ce5 NOBUG: Increase file size to avoid random failures 2024-07-03 13:40:22 +08:00
Huong Nguyen f312621f0d MDL-82363 Calendar: Responsiveness improvement for calendar block
Hide the month name if the screen is too small
2024-07-03 11:02:36 +07:00
djarrancotleanu 6ad723885c MDL-78388 course: Copy permissions when duplicating module 2024-07-03 13:49:00 +10:00
Shamim Rezaie 2119c703d2 Merge branch 'MDL-82329-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-03 04:06:50 +10:00
Paul Holden 42938d2dd4 MDL-82360 courseformat: remove console upload error string debugging. 2024-07-02 15:55:27 +01:00
Paul Holden 462357ebf0 MDL-77834 mod_feedback: consistent HTML decoding of answer data.
Restores functionality from 72629ee8c0 that went missing along the way.
2024-07-01 16:22:00 +01:00
Luca Bösch a79853672e MDL-81959 qtype_multianswer: Margin between checkboxes and text 2024-07-01 16:16:13 +02:00
Paul Holden 75b3607fc3 MDL-81349 group: case-sensitive name validation when editing. 2024-07-01 09:41:43 +01:00
Huong Nguyen f142770c37 Merge branch 'MDL-79758_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-07-01 14:25:16 +07:00
Huong Nguyen cf92d64a57 Merge branch 'MDL-79971-404' of https://github.com/aanabit/moodle into MOODLE_404_STABLE 2024-07-01 14:16:45 +07:00
Huong Nguyen 6771eb805b Merge branch 'MDL-79796_404' of https://github.com/AnupamaSarjoshi/moodle into MOODLE_404_STABLE 2024-07-01 14:10:08 +07:00
Huong Nguyen 6c7121254d Merge branch 'MDL-73091-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-07-01 14:05:36 +07:00
Leon Stringer f523a01673 MDL-82323 core: Fix get_striptags must be bool
If an exception occurs during install $CFG->formatstringstriptags may
not be populated, if so fall back to a default value.
2024-06-28 10:23:49 +01:00
Paul Holden 75791eabea MDL-82245 restore: use translated lang string in page heading. 2024-06-28 10:03:09 +01:00
Amaia Anabitarte 2c804c3ab2 MDL-79971 completion: Don't assume a completed activity is viewed 2024-06-28 10:16:28 +02:00
Paul Holden 044e924d8a MDL-82329 course: consistent section permalink on view/section pages. 2024-06-28 08:59:54 +01:00
Paul Holden 6b01e331e6 MDL-82315 backup: account for null course section sequence value. 2024-06-27 23:34:48 +01:00
Sara Arjona 87d7ac1f81 weekly release 4.4.1+ 2024-06-27 16:36:48 +02:00
Sara Arjona 09c7a41d7f Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2024-06-27 16:36:45 +02:00
Stephan Robotta 219d5bfb44 MDL-79758 qbank: add filter in pagination links
Contains some minor tweaks by Tim Hunt <T.J.Hunt@open.ac.uk>.
2024-06-27 09:22:31 +01:00
Huong Nguyen 32d08ee47f Merge branch 'MDL-62958-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-27 11:05:03 +07:00
Huong Nguyen ef45ffc444 Merge branch 'MDL-82251-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-27 10:56:26 +07:00
Huong Nguyen 52cbcdbca7 Merge branch 'MDL-82008-404' of https://github.com/lucaboesch/moodle into MOODLE_404_STABLE 2024-06-27 10:26:47 +07:00
Jun Pataleta 97c21add9e Merge branch 'MDL-79809-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-06-27 11:01:33 +08:00
Andrew Nicols 15d331c058 MDL-63670 core_message: Tests should not use another testcase as base 2024-06-27 08:55:33 +08:00
Tim Hunt 2ac781b76d MDL-82308 forms: set a nice default size for multi-selects
This is a backport of MDL-81515.
2024-06-26 13:24:24 +01:00
Sara Arjona 6d4ea3f3c2 Merge branch 'MDL-80625-404' of https://github.com/ssj365/moodle into MOODLE_404_STABLE 2024-06-26 12:14:56 +02:00
Sara Arjona b0b17142c7 Merge branch 'MDL-80344-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-26 12:11:17 +02:00
Huong Nguyen 306b5289a7 MDL-81991 core: Reload accessdata for dirty users in CLI mode 2024-06-26 16:27:46 +07:00
Huong Nguyen 99ae088704 MDL-78936 editor_tiny: Disable quickbars for small target
The quickbars selection toolbar is not displayed correctly
if the target element is too small. We will wait for it
to be fixed in the future before we re-enable it in Moodle
2024-06-26 10:16:52 +07:00
Ilya Tregubov 7605966155 Merge branch 'MDL-82233-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2024-06-26 10:24:02 +08:00
Ilya Tregubov 0f7d291b9c Merge branch 'MDL-82167-404' of https://github.com/ferranrecio/moodle into MOODLE_404_STABLE 2024-06-26 10:19:59 +08:00
Sara Arjona ff2164fd3d Merge branch 'MDL-79231-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2024-06-25 16:13:01 +02:00
Sara Arjona b1072fc937 Merge branch 'MDL-82160-404' of https://github.com/roland04/moodle into MOODLE_404_STABLE 2024-06-25 16:00:06 +02:00
Huong Nguyen 81900583fe Merge branch 'MDL-82277-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-25 13:53:54 +07:00
Wolfgang Reichert 9dde27f0bb MDL-73091 core_badges: Avoid undefined variable notice in review
* Fix review method for award_criteria_courseset when courseset is empty
* Add unit tests for coverage of the award_criteria_courseset class

@co-authored jz-reichert@web.de
2024-06-25 08:47:34 +02:00
Huong Nguyen 40ffccc33b Merge branch 'MDL-82200_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-06-25 09:13:43 +07:00
Huong Nguyen 1975be2909 Merge branch 'MDL-80061-404' of https://github.com/ssj365/moodle into MOODLE_404_STABLE 2024-06-25 09:07:21 +07:00
Paul Holden 160617d2d5 MDL-82024 format_topics: toggle un/highlight section icon correctly. 2024-06-24 19:48:48 +01:00
Paul Holden 2b42e986e3 MDL-82277 mod_h5pactivity: less fragile error Behat step assertion.
Avoids frequent failures related to iframe resizing/timing.
2024-06-24 15:55:58 +01:00
Paul Holden e9683d416f MDL-62958 admin: ensure uploaded plugin directory structure present.
Including any empty directories, which would cause validation to
subsequently fail when they were skipped.

Co-authored-by: Leon Stringer <leon.stringer@ntlworld.com>
2024-06-24 12:47:38 +01:00
Huong Nguyen 85c8395e52 MDL-79809 environment: Moodle 4.5 requirements 2024-06-24 09:37:15 +07:00
AMOS bot fa80a0b8a5 Automatically generated installer lang files 2024-06-22 00:14:10 +00:00
Daniel Ziegenberg 10eead2473 MDL-31192 core_webservice: do not render div inside span
`<span>` tags only permit "phrasing content" but `<div>` (and also the
`<ins>` tag) are flow content. So, switching to div all along.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-06-21 16:32:35 +02:00
Martin Gauk f341c774de MDL-80345 core_lock: deal with hash collisions in postgres_lock_factory 2024-06-21 13:42:59 +02:00
Mikel Martín 731bf1cb78 MDL-82160 renderer: Add render_context_header method to core_renderer
In MDL-81597 the original render_context_header method was removed and converted to a template.
That caused a regression, so this patch adds the method again but using the new template.
2024-06-21 11:55:56 +02:00
Luca Bösch 18bf9704e7 MDL-82008 backup: Format 'Continue' and 'Cancel' button to have a margin 2024-06-21 09:37:02 +02:00
Sara Arjona cd781ab1b7 weekly release 4.4.1+ 2024-06-20 16:30:56 +02:00
Sara Arjona 7ec026173e Merge branch 'install_404_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_404_STABLE 2024-06-20 16:30:51 +02:00
Paul Holden ce6b2f77c9 MDL-82251 customfield: correct field management icon sizes. 2024-06-20 09:55:18 +01:00
David Woloszyn d3078a3f53 MDL-79231 core_theme: Fix Tiny menu in fullscreen mode modals 2024-06-20 14:32:57 +10:00
David Woloszyn d5be1b502f MDL-79231 mod_assign: Fix Tiny menu in fullscreen mode 2024-06-20 14:32:57 +10:00
Huong Nguyen a74b702a23 Merge branch 'MDL-78773-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-20 11:06:22 +07:00
Jun Pataleta 4246ca2fbf Merge branch 'MDL-82246-404' of https://github.com/andrewnicols/moodle into MOODLE_404_STABLE 2024-06-20 11:41:49 +08:00
Huong Nguyen 931f11899a Merge branch 'MDL-82202-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-20 10:21:13 +07:00
Andrew Nicols f3ade2b67a MDL-82246 tiny_recordrtc: Correct string name for insecure alert title 2024-06-20 10:58:13 +08:00
Huong Nguyen a1334d14d7 Merge branch 'MDL-81761-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-20 09:54:48 +07:00
Huong Nguyen c2cd21be15 Merge branch 'MDL-82169-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-20 09:19:45 +07:00
AMOS bot 3fb33d314e Automatically generated installer lang files 2024-06-20 00:16:24 +00:00
Sara Arjona e075cb4c1d Merge branch 'MDL-81534-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-19 16:49:56 +02:00
Sara Arjona 7cb072b11e Merge branch 'MDL-81857-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-19 15:53:02 +02:00
Sara Arjona d84efee3e2 Merge branch 'MDL-82181-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-19 15:42:27 +02:00
Sara Arjona 5fbdb37d60 Merge branch 'MDL-81730-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-19 13:31:39 +02:00
meirzamoodle f8eecf37d9 MDL-75864 cache: Change key prefix in cache_cron_task
Currently, the cache_cron_task is set to look for 'sess_' as a key prefix,
which is not used in any code. As a result, sessions that have exceeded the timeout are never deleted.

The proposed patch involves changing the prefix to the LASTACCESS key prefix and
fixing the return value of get_many in the Redis cache so that it can return the required keys.

Co-authored-by: Renaud Lemaire <rlemaire@cblue.be>
2024-06-19 13:42:50 +07:00
Sara Arjona 4bdf820437 Merge branch 'MDL-77665-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-06-19 07:35:22 +02:00
Huong Nguyen d59f7a04f0 Merge branch 'MDL-81249-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-06-19 09:18:33 +07:00
Andrew Nicols 1d753e37af Merge branch 'MDL-81644-404-new' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-06-18 23:25:33 +08:00
Andrew Nicols 77c9660195 Merge branch 'MDL-81431-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-06-18 22:50:44 +08:00
Andrew Nicols 877e585704 Merge branch 'MDL-81739-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2024-06-18 22:34:10 +08:00
Sara Arjona f64d94dd62 MDL-82233 badges: Display awarded users only when it applies
The message with the number of uses who have awarded a badge
were displayed always (even when the badge was disabled).
2024-06-18 16:06:49 +02:00
Angelia Dela Cruz f6f6475b8e MDL-81249 gradingform: Behat test that grades are retained 2024-06-18 18:07:47 +08:00
Angelia Dela Cruz e877329be1 MDL-81249 gradingform: Enhance Behat test for deleting marking guide 2024-06-18 17:46:26 +08:00
Huong Nguyen 26824c239e Merge branch 'MDL-82148_404' of https://github.com/stronk7/moodle into MOODLE_404_STABLE 2024-06-18 16:27:43 +07:00
Shamim Rezaie 6aa18b9c05 Merge branch 'mdl-78080-404-split' of https://github.com/james-cnz/moodle into MOODLE_404_STABLE 2024-06-18 16:06:10 +10:00
lameze d348237022 MDL-81431 behat: set grade item checkboxes one at the time 2024-06-18 13:58:16 +08:00
Paul Holden 114ddf489e MDL-82202 course: correct last access report entity column callback.
Ensure it works when being aggregated.
2024-06-17 14:27:09 +01:00
Laurent David f78c93e325 MDL-77665 mod_h5pactivity: Improve generator package upload
* Allow the specification of the username in order to set the owner
of the H5P file package when creating a new H5P instance.
2024-06-17 06:32:13 +02:00
Laurent David 941c866216 MDL-77665 core_h5p: Allow deployment if user has been deleted
* If user has been deleted we consider that the content can be deployed
by a user who can deploy other packages
* Add behat test to cover for this use case
* Fix the content bank generator as it was failing to upload the content
as the given user
2024-06-17 06:32:13 +02:00
James C d9ba8ea3f3 MDL-78080 course: Duplicate section: Duplicate by section id, not num 2024-06-17 12:36:04 +12:00
James C 6e41020e44 MDL-78080 course: Duplicate section: No duplicate option for section 0 2024-06-17 12:36:04 +12:00
James C 2be9aaf311 MDL-78080 course: Duplicate section: Don't copy deleted activities 2024-06-17 12:36:04 +12:00
James C ac65869391 MDL-78080 course: Duplicate section: Copy section summary files 2024-06-17 12:35:38 +12:00
James C f7184f748f MDL-78080 course: Duplicate section: Copy custom section options 2024-06-17 12:32:47 +12:00
James C 40995c1030 MDL-78080 course: Duplicate section: Fix course_update_section params 2024-06-17 12:32:15 +12:00
Eloy Lafuente (stronk7) 202c58888a MDL-82148 phpunit: Remove all cases of multiple @coversDefaultClass
Only one by class is allowed (to be used as shortcut exclusively).
2024-06-14 16:05:15 +02:00
Tim Hunt 6d35be2af2 MDL-82200 inplace editable: fix background of the help text 2024-06-14 12:59:37 +01:00
Anupama Sarjoshi 754768bad3 MDL-79796 quiz: Preview icon should be visible in question bank pop-up 2024-06-14 11:50:53 +01:00
Ilya Tregubov fbed8034eb weekly release 4.4.1+ 2024-06-14 08:57:00 +08:00
Eric Merrill 73713bd675 MDL-82192 scorm: Correct field names for AICC ExitAu 2024-06-13 18:38:49 -04:00
Jun Pataleta 347ade6e68 Merge branch 'MDL-81287-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-13 12:03:21 +08:00
Jun Pataleta ece31e87a6 Merge branch 'MDL-82178_404' of https://github.com/timhunt/moodle into MOODLE_404_STABLE 2024-06-13 12:00:35 +08:00
Huong Nguyen 7b3d547f4a Merge branch 'MDL-81577-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-13 10:55:57 +07:00
Huong Nguyen 89d93d2632 Merge branch 'MDL-82184-dbcollation-comment-404' of https://github.com/leonstr/moodle into MOODLE_404_STABLE 2024-06-13 10:19:37 +07:00
Huong Nguyen d1f4ca4505 Merge branch 'MDL-81781-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-13 10:13:00 +07:00
Huong Nguyen f5a2ddef9f Merge branch 'MDL-69514-404' of https://github.com/pedrojordao/moodle into MOODLE_404_STABLE 2024-06-13 09:54:11 +07:00
Jun Pataleta 533deb42af Merge branch 'MDL-79885-404' of https://github.com/Chocolate-lightning/moodle into MOODLE_404_STABLE 2024-06-13 10:37:39 +08:00
Huong Nguyen 15b422f3a7 Merge branch 'MDL-82162-404' of https://github.com/sarjona/moodle into MOODLE_404_STABLE 2024-06-13 09:14:05 +07:00
Mathew May 17f080683d MDL-79885 qtype_ordering: Add learner behat testing 2024-06-13 10:11:10 +08:00
Huong Nguyen 9874249ad1 Merge branch 'MDL-82155-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-13 09:03:12 +07:00
Shamiso.Jaravaza 7fae6efbd8 MDL-80061 mod_bigbluebuttonbn: Change filter field
* Change dismissed recording time filter from timecreated to timemodified
2024-06-12 13:52:05 -06:00
Leon Stringer e4a8fd37f0 MDL-82184 database: Revise dbcollation comment 2024-06-12 18:15:30 +01:00
Paul Holden c8bdae260b MDL-82181 tiny_media: correctly determine whether to show dropzone. 2024-06-12 14:19:47 +01:00
Tim Hunt 200eb30225 MDL-82178 quiz graded notification: fix capability check
Also improve the scheduled task logging
2024-06-12 12:40:26 +01:00
Huong Nguyen d3890caed1 Merge branch 'MDL-81332-404' of https://github.com/andelacruz/moodle into MOODLE_404_STABLE 2024-06-12 13:15:44 +07:00
Jun Pataleta 3f1f6192ea Merge branch 'MDL-81355-404' of https://github.com/lameze/moodle into MOODLE_404_STABLE 2024-06-12 10:38:11 +08:00
Michael Aherne bf51502049 MDL-81355 phpdoc: Fix incorrect phpdocs on block_base. 2024-06-12 10:32:42 +08:00
Huong Nguyen 0d1cbfb3b7 Merge branch 'MDL-82001-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-12 09:01:39 +07:00
Huong Nguyen 6d717d9c8a Merge branch 'MDL-81522_404' of https://github.com/stronk7/moodle into MOODLE_404_STABLE 2024-06-12 08:46:59 +07:00
Paul Holden 4d4efaa72c MDL-82169 user: remove access to non-existent $options array. 2024-06-11 21:25:59 +01:00
ferranrecio b2ce12db1d MDL-82167 core: fix reactive debug panel 2024-06-11 16:16:25 +02:00
Sara Arjona 96c159f032 MDL-82162 tool: Switch to admin when executing runtestscenario by CLI
When the runtestscenario is executed via CLI, generators requiring a valid
$USER will fail.
This patch switches to the admin user, consistent with the approach used
in other simlar CLI scripts.
2024-06-11 13:27:18 +02:00
Ilya Tregubov c260c622b9 Merge branch 'MDL-81510-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-06-11 18:59:32 +08:00
Laurent David 71f5eee793 MDL-81510 core_courseformat: Fix activity highlight in index
* When directly accessing the module with the #module-xxx anchor
we should highlight the module as the current page item.
2024-06-11 12:47:38 +02:00
Eloy Lafuente (stronk7) 2a86638a15 MDL-81522 phpunit: Add a few non-void return types to tests
This is the final (3rd) commit, where we are adding missing
return types to a few tests (using @depends) which return
types are non-void, but something really returned (for consume
by the dependent test).
2024-06-11 12:18:05 +02:00
Eloy Lafuente (stronk7) 091b458c52 MDL-81522 phpunit: Add missing void return type to all tests #2
This commit includes more changes, all them also adding the :void
return type to unit tests missing them.

The difference is that all these changes, while also detected
perfectly by the moodle.PHPUnit.TestReturnType sniff, were not
auto-fixed (like the previous commit ones), because all them
do include some "return" statement and, for safety, we don't
fix them.

All the cases have been visually inspected and confirmed that
the existing "return" statements always belong to anon
functions within the test body and not the test own return statement.
2024-06-11 12:18:05 +02:00
Eloy Lafuente (stronk7) 1093256560 MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 12:18:04 +02:00
Huong Nguyen 7b6070003a MDL-68540 tool_usertours: Remove hideif workaround
We don't need to use the group element to use hideif
for text editor element anymore
2024-06-11 15:32:47 +07:00
Huong Nguyen d376d8cdbf Merge branch 'MDL-68540-404' of https://github.com/davewoloszyn/moodle into MOODLE_404_STABLE 2024-06-11 15:32:23 +07:00
Angelia Dela Cruz 5541cd1af9 MDL-81332 core_course: Behat test for grade and activity reports display 2024-06-11 16:17:00 +08:00
Jun Pataleta dd345ab8ee Merge branch 'MDL-81428-404' of https://github.com/HuongNV13/moodle into MOODLE_404_STABLE 2024-06-11 13:41:49 +08:00
David Woloszyn 90c5adee7c MDL-68540 form: Correctly target editors in node tree
This fix solves the hideIf and disabledIf form conditions that were not
correctly targetting the editor due to a name attribute mismatch.
2024-06-11 13:06:12 +10:00
Paul Holden d5395c4f47 MDL-82155 core: define/correct third party library names. 2024-06-10 19:52:08 +01:00
Shamiso.Jaravaza 84a3e73aa0 MDL-80625 mod_bigbluebuttonbn: Fix param name 2024-06-10 10:13:35 -06:00
Pedro Jordao c0a966d944 MDL-69514 Core: Close popover when modal is closed
Currently in Firefox, if we opened a popover that was inside a modal
and closed the modal by pressing the ESC key, the popover remained on
the screen. With this change, we will ensure that popovers are closed
when the modal is closed.
2024-06-10 12:14:44 -03:00
Sara Arjona 844247aecf Merge branch 'MDL-81949-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-10 16:46:38 +02:00
Sara Arjona 90f138fced Merge branch 'MDL-81678-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-10 16:39:16 +02:00
Sara Arjona 6a46e9524b Merge branch 'MDL-70972-MOODLE_404_STABLE' of https://github.com/PhMemmel/moodle into MOODLE_404_STABLE 2024-06-10 12:33:26 +02:00
Huong Nguyen 21b4aac782 MDL-81428 theme_boost: Match .disabled opacity with .text-muted 2024-06-10 17:08:22 +07:00
Huong Nguyen 83b9f0e29d MDL-81428 core: Display the correct status for the contact request 2024-06-10 17:08:22 +07:00
Ilya Tregubov 6d4a0cbcb2 Merge branch 'MDL-81510-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-06-10 13:31:56 +08:00
Paul Holden 06b9cbdefd MDL-81949 tool_replace: prompt user for unrecognised CLI parameters. 2024-06-07 11:41:03 +01:00
Paul Holden 2b4769bb73 MDL-81678 enrol: don't escape course name in welcome message. 2024-06-07 11:39:43 +01:00
Paul Holden e858c2e747 MDL-78773 report_stats: improve display of mode selection element.
Make use of existing theme selectors for navigation elements to style.
2024-06-07 11:34:17 +01:00
Paul Holden 222fb603c0 MDL-81781 report_log: escape description selectively on display/export.
Per cd85e090f3 all content was escaped, however we should only do that
when displaying the value in browser or exporting to file format which
supports HTML.
2024-06-07 11:30:18 +01:00
Paul Holden f2dbbfe66e MDL-81781 dataformat: public helper method to get writer instance. 2024-06-07 11:30:18 +01:00
Meirza 821f2a390c MDL-81644 calendar: The behaviour of event dates in the block calendar
There is a difference in the behaviour of the calendar block when it is on the calendar page and when it is not.
On the calendar page, when the user clicks on the date or link next/previous month or day name in the calendar block,
it will have the effect of changing the URL, which should not happen.

The patch also includes hiding popover after the user clicks the day number. When the user clicks on the date or
is focused on the date and then presses enter on the keyboard, the popover does not automatically close.
To fix this, I added an event type, "click", to be attached to the hidePopover function and added conditioning to
the target element when there was a "click" event.

An additional step was added to the Behat calendar for the click event to ease the testing process.

For the popover, I set the "animation" to false to avoid the random Behat failure caused by the slow animation.
2024-06-07 14:45:24 +07:00
Laurent David ac692ebbf6 MDL-81510 core_courseformat: Do not reset the scroll position
* Revert the change made in MDL-75762 which would wait and change
  course index selection depending on the actual scroll position
2024-06-07 09:39:32 +02:00
Laurent David 40960e49bc MDL-81510 core_courseformat: Expand course section to show activity
* When a course activity is specified via an anchor in the URL we
should expand the course content containing the activity
* When we point to a specific activity via an anchor in the URL we should
expand the course index (section) surrounding the actitity.
2024-06-07 09:39:32 +02:00
Paul Holden 1bff691a64 MDL-81857 user: don't check whether address is an identity field.
It can never be selected as one, so the previous comparison could
never pass.
2024-06-06 08:58:42 +01:00
David Woloszyn 1913cdb088 MDL-81739 tiny_noautolink: Remove URL checking when preventing auto-link 2024-06-06 15:06:04 +10:00
Paul Holden 2ed6a57f36 MDL-80344 calendar: correct no subscriptions language string use.
Ensure expected parameters are present; avoid string concatenation.
2024-06-05 15:52:18 +01:00
Philipp Memmel 2692097272 MDL-70972 format_singleactivity: Apply new behavior to behat test 2024-06-04 06:36:49 +00:00
Philipp Memmel 11ca67f853 MDL-70972 format_singleactivity: Show activities when creating course
Co-authored-by: Laurent David <lmedavid@gmail.com>
2024-06-04 06:36:49 +00:00
Paul Holden 4d5289e599 MDL-81534 tool_generator: standardize user creation language string. 2024-06-03 09:43:15 +01:00
Paul Holden 89d9032e4d MDL-81577 mod: correct arguments when formatting text for RSS. 2024-05-30 19:17:27 +01:00
Paul Holden a49c099ae5 MDL-82001 mod_quiz: respect user language in draft save message text. 2024-05-30 16:04:58 +01:00
Paul Holden 20d6ffb9ee MDL-81730 assignsubmission_file: deterministic submission file order. 2024-05-20 20:16:18 +01:00
Paul Holden fbd18d8ead MDL-81761 gradingform_guide: remove duplicate click of frequent comment. 2024-05-20 17:40:45 +01:00
Paul Holden dfde819c8b MDL-81287 mod_forum: observe default discussion paging value. 2024-05-15 13:23:17 +01:00
Marina Glancy ad9d4bb4af MDL-80907 various: fixes to incorrect column selectors in behat 2024-05-07 19:28:46 +01:00
Marina Glancy 569d9dfe39 MDL-80907 behat: be more precise in selecting table rows 2024-05-07 19:28:37 +01:00
1899 changed files with 17900 additions and 12866 deletions
-1
View File
@@ -4,7 +4,6 @@ on:
push:
branches-ignore:
- main
- master
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
+23
View File
@@ -0,0 +1,23 @@
name: Web Installer Testing
on:
workflow_dispatch:
jobs:
InstallationTest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1, 8.3]
steps:
- name: Construct repository URL
run: echo "REPOSITORY_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
shell: bash
- uses: moodlehq/moodle-webinstaller-test@main
with:
repository: ${{ env.REPOSITORY_URL }}
branch: ${{ github.ref_name }}
php: ${{ matrix.php }}
+3 -1
View File
@@ -26,7 +26,9 @@
/.patches/
/.idea/
.phpstorm.*
!.phpstorm.meta.php
!/.phpstorm.meta.php/
/.phpstorm.meta.php/*
!/.phpstorm.meta.php/di.php
/nbproject/
CVS
.DS_Store
@@ -500,4 +500,15 @@ abstract class plugin_management_table extends flexible_table implements dynamic
protected function supports_ordering(): bool {
return $this->plugininfoclass::plugintype_supports_ordering();
}
/**
* Check if the user has the capability to access this table.
*
* Default implementation for plugin management tables is to require 'moodle/site:config' capability
*
* @return bool Return true if capability check passed.
*/
public function has_capability(): bool {
return has_capability('moodle/site:config', $this->get_context());
}
}
+3 -7
View File
@@ -177,6 +177,7 @@ $CFG->admin = array_pop($parts);
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
require_once($CFG->libdir.'/classes/component.php');
require_once($CFG->libdir.'/classes/text.php');
require_once($CFG->libdir.'/classes/string_manager.php');
require_once($CFG->libdir.'/classes/string_manager_install.php');
@@ -192,13 +193,8 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/componentlib.class.php');
require_once($CFG->dirroot.'/cache/lib.php');
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
if (defined('COMPONENT_CLASSLOADER')) {
spl_autoload_register(COMPONENT_CLASSLOADER);
} else {
spl_autoload_register('core_component::classloader');
}
// Register our classloader.
\core_component::register_autoloader();
require($CFG->dirroot.'/version.php');
$CFG->target_release = $release;
+195
View File
@@ -4508,4 +4508,199 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.5" requires="4.1.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.6.7" />
<VENDOR name="mysql" version="8.0" />
<VENDOR name="postgres" version="13" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="19" />
</DATABASE>
<PHP version="8.1.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="exif" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
<FEEDBACK>
<ON_ERROR message="sixtyfourbitsrequired" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
<FEEDBACK>
<ON_CHECK message="iscustomadminwarnings" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_oracle_usage" level="optional">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
@@ -36,7 +36,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_metadata().
* @covers ::get_metadata
*/
public function test_get_metadata() {
public function test_get_metadata(): void {
$collection = new collection('core_adminpresets');
$newcollection = provider::get_metadata($collection);
$itemcollection = $newcollection->get_collection();
@@ -49,7 +49,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_contexts_for_userid() doesn't return any context.
* @covers ::get_contexts_for_userid
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $USER;
$this->resetAfterTest();
@@ -67,7 +67,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::get_users_in_context() doesn't return any user.
* @covers ::get_users_in_context
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
global $USER;
$this->resetAfterTest();
@@ -88,7 +88,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::export_user_data().
* @covers ::export_user_data
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
global $USER;
$this->resetAfterTest();
@@ -121,7 +121,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::delete_data_for_all_users_in_context().
* @covers ::delete_data_for_all_users_in_context
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB, $USER;
$this->resetAfterTest();
@@ -146,7 +146,7 @@ class privacy_provider_test extends provider_testcase {
* Test for provider::delete_data_for_user().
* @covers ::delete_data_for_user
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB, $USER;
$this->resetAfterTest();
+2 -2
View File
@@ -27,7 +27,7 @@ use core_role_preset;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class preset_test extends \advanced_testcase {
public function test_xml() {
public function test_xml(): void {
global $DB;
$roles = $DB->get_records('role');
@@ -81,7 +81,7 @@ class preset_test extends \advanced_testcase {
* Tests covered method.
* @covers \core_role_preset::parse_preset
*/
public function test_mixed_levels() {
public function test_mixed_levels(): void {
// The problem here is that we cannot guarantee plugin contexts
// have unique short names, so we have to also support level numbers.
$xml = file_get_contents(__DIR__ . '/fixtures/mixed_levels.xml');
+9 -9
View File
@@ -45,7 +45,7 @@ class provider_test extends provider_testcase {
* Test to check export_user_preferences.
* returns user preferences data.
*/
public function test_export_user_preferences() {
public function test_export_user_preferences(): void {
$this->resetAfterTest();
$this->setAdminUser();
$user = $this->getDataGenerator()->create_user();
@@ -64,7 +64,7 @@ class provider_test extends provider_testcase {
/**
* Check all contexts are returned if there is any user data for this user.
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $DB;
$this->resetAfterTest();
@@ -114,7 +114,7 @@ class provider_test extends provider_testcase {
/**
* Test that user data is exported correctly.
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
global $DB;
$this->resetAfterTest();
@@ -243,7 +243,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
$this->resetAfterTest();
@@ -329,7 +329,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
$this->resetAfterTest();
@@ -387,7 +387,7 @@ class provider_test extends provider_testcase {
/**
* Export for a user with a key against a script where no instance is specified.
*/
public function test_export_user_role_to_cohort() {
public function test_export_user_role_to_cohort(): void {
global $DB;
$this->resetAfterTest();
@@ -443,7 +443,7 @@ class provider_test extends provider_testcase {
/**
* Test for provider::delete_user_role_to_cohort().
*/
public function test_delete_user_role_to_cohort() {
public function test_delete_user_role_to_cohort(): void {
global $DB;
$this->resetAfterTest();
@@ -478,7 +478,7 @@ class provider_test extends provider_testcase {
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
global $DB;
$this->resetAfterTest();
@@ -599,7 +599,7 @@ class provider_test extends provider_testcase {
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$this->resetAfterTest();
+3 -1
View File
@@ -152,7 +152,9 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$sensiblesettingsdefault .= 'server_password@@search_solr, ssl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'alternateserver_password@@search_solr, alternatessl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'test_password@@cachestore_redis, password@@mlbackend_python, ';
$sensiblesettingsdefault .= 'badges_badgesalt@@none, calendar_exportsalt@@none';
$sensiblesettingsdefault .= 'badges_badgesalt@@none, calendar_exportsalt@@none, ';
$sensiblesettingsdefault .= 'bigbluebuttonbn_shared_secret@@none, apikey@@tiny_premium, ';
$sensiblesettingsdefault .= 'matrixaccesstoken@@communication_matrix, api_secret@@factor_sms';
$temp->add(new admin_setting_configtextarea('adminpresets/sensiblesettings',
get_string('sensiblesettings', 'core_adminpresets'),
get_string('sensiblesettingstext', 'core_adminpresets'),
@@ -38,6 +38,6 @@
}
}}
<div class="form-checkbox defaultsnext">
<input type="hidden" name="{{name}}" value="{{no}}">
{{^readonly}}<input type="hidden" name="{{name}}" value="{{no}}">{{/readonly}}
<input {{#readonly}}disabled{{/readonly}} type="checkbox" name="{{name}}" value="{{value}}" id="{{id}}" {{#checked}}checked{{/checked}}>
</div>
@@ -35,7 +35,7 @@
}
}}
<div class="form-multicheckbox">
<input type="hidden" name="{{name}}[xxxxx]" value="1">
{{^readonly}}<input type="hidden" name="{{name}}[xxxxx]" value="1">{{/readonly}}
{{#hasoptions}}
<ul>
{{#options}}
@@ -40,7 +40,7 @@
Setting configmultiselect.
}}
<div class="form-select">
<input type="hidden" name="{{name}}[xxxxx]" value="1">
{{^readonly}}<input type="hidden" name="{{name}}[xxxxx]" value="1">{{/readonly}}
<select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
{{#options}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
@@ -59,7 +59,7 @@
Setting configmultiselect with optgroup support.
}}
<div class="form-select">
<input type="hidden" name="{{name}}[xxxxx]" value="1">
{{^readonly}}<input type="hidden" name="{{name}}[xxxxx]" value="1">{{/readonly}}
<select {{#readonly}}disabled{{/readonly}} id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
{{#options}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+6 -6
View File
@@ -18,7 +18,7 @@ Feature: An administrator can browse user accounts
When I navigate to "Users > Accounts > Browse list of users" in site administration
# Name field always present, email field is default for showidentity.
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
# Should not see other identity fields or non-default name fields.
@@ -34,7 +34,7 @@ Feature: An administrator can browse user accounts
| alternativefullnameformat | firstnamephonetic lastname |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name - phonetic / Last name | Email address |
| First name - phonetic | Email address |
| Yewzer One | one@example.com |
| Yoozare Two | two@example.com |
@@ -43,7 +43,7 @@ Feature: An administrator can browse user accounts
| showuseridentity | department,profile_field_frog |
When I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Favourite frog | Department |
| First name | Favourite frog | Department |
| User One | Kermit | Attack |
| User Two | Tree | Defence |
And I should not see "Email address" in the "table" "css_element"
@@ -103,7 +103,7 @@ Feature: An administrator can browse user accounts
| user3 | User | Three | three@example.com | Glass |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
| User Three | three@example.com |
@@ -137,7 +137,7 @@ Feature: An administrator can browse user accounts
| user2 | C1 | student |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
And I click on "Filters" "button"
@@ -166,7 +166,7 @@ Feature: An administrator can browse user accounts
| user1 | coursecreator | system | |
And I navigate to "Users > Accounts > Browse list of users" in site administration
Then the following should exist in the "reportbuilder-table" table:
| First name / Last name | Email address |
| First name | Email address |
| User One | one@example.com |
| User Two | two@example.com |
| User Three | three@example.com |
-22
View File
@@ -48,25 +48,3 @@ Feature: View task logs report and use its filters
| operator | shouldornotsee |
| Less than | should not see |
| Greater than | should see |
@javascript
Scenario: Reset task log filters
Given I log in as "admin"
And I change window size to "large"
And I navigate to "Server > Tasks > Task logs" in site administration
When I click on "Filters" "button"
And I set the following fields in the "Result" "core_reportbuilder > Filter" to these values:
| Result operator | Is equal to |
| Result value | Fail |
And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
Then I should see "Filters applied"
And I should see "Filters (1)" in the "#dropdownFiltersButton" "css_element"
And I should see "Nothing to display"
And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element"
And I should see "Filters reset"
And I should not see "Filters (1)" in the "#dropdownFiltersButton" "css_element"
And I should see "Filters" in the "#dropdownFiltersButton" "css_element"
And "[data-region='report-filters']" "css_element" should be visible
And the following fields in the "Result" "core_reportbuilder > Filter" match these values:
| Result operator | Is any value |
And I should not see "Nothing to display"
@@ -30,7 +30,7 @@ class preset_deleted_test extends \advanced_testcase {
/**
* Test preset_deleted event.
*/
public function test_preset_deleted_event() {
public function test_preset_deleted_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_downloaded_test extends \advanced_testcase {
/**
* Test preset_downloaded event.
*/
public function test_preset_downloaded_event() {
public function test_preset_downloaded_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_exported_test extends \advanced_testcase {
/**
* Test preset_exported event.
*/
public function test_preset_exported_event() {
public function test_preset_exported_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_imported_test extends \advanced_testcase {
/**
* Test preset_imported event.
*/
public function test_preset_imported_event() {
public function test_preset_imported_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_loaded_test extends \advanced_testcase {
/**
* Test preset_loaded event.
*/
public function test_preset_loaded_event() {
public function test_preset_loaded_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_previewed_test extends \advanced_testcase {
/**
* Test preset_previewed event.
*/
public function test_preset_previewed_event() {
public function test_preset_previewed_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class preset_reverted_test extends \advanced_testcase {
/**
* Test preset_reverted event.
*/
public function test_preset_reverted_event() {
public function test_preset_reverted_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class presets_listed_test extends \advanced_testcase {
/**
* Test presets_listed event.
*/
public function test_presets_listed_event() {
public function test_presets_listed_event(): void {
$this->resetAfterTest();
$this->setAdminUser();
+2 -2
View File
@@ -50,7 +50,7 @@ class external_test extends externallib_advanced_testcase {
/**
* test_potential_contexts description
*/
public function test_potential_contexts() {
public function test_potential_contexts(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -71,7 +71,7 @@ class external_test extends externallib_advanced_testcase {
/**
* test_potential_contexts description
*/
public function test_potential_contexts_no_manager() {
public function test_potential_contexts_no_manager(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -70,7 +70,7 @@ class behat_form_text_test extends \basic_testcase {
* @param mixed $expectation value to be checked.
* @dataProvider provider_test_set_get_value()
*/
public function test_set_get_value($value, $expectation) {
public function test_set_get_value($value, $expectation): void {
$session = $this->createMock(Session::class);
$node = $this->createMock(NodeElement::class);
$node->method('getValue')->willReturn($value);
@@ -115,7 +115,7 @@ class behat_form_text_test extends \basic_testcase {
* @param bool $result expected return status of the function.
* @dataProvider provider_test_matches()
*/
public function test_matches($decsep, $value, $match, $result) {
public function test_matches($decsep, $value, $match, $result): void {
global $CFG;
// Switch of string manager to avoid having to (slow) customise the lang file.
@@ -245,7 +245,6 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
return $luminosity;
}
/**
* Returns the decimal equivalents for a HEX color. Returns null if it cannot be determined.
* @param string $color The hex color value
@@ -268,13 +267,21 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
*/
public function convert_color(string $color): string {
$color = trim($color);
if (strpos($color, ' ') !== false) {
$colors = explode(' ', $color);
foreach ($colors as $backgroundpart) {
if (substr(trim($backgroundpart), 0, 1) == '#' ||
in_array(trim($backgroundpart), array_keys($this->colornames)) ||
strtolower(substr(trim($backgroundpart), 0, 3)) == 'rgb') {
$color = $backgroundpart;
// Search for color in rgb format first, as this can potentially contain a space.
if (strpos($color, 'rgb') !== false) {
$colors = explode('rgb', $color, 2); // Getting 2 only in array.
// Getting end point of rgb value, i.e. the end bracket.
$endpos = strpos($colors[1], ')');
$color = 'rgb' . substr($colors[1], 0, ($endpos + 1)); // Recompiling rgb value.
} else {
// Splitting multi-value css background value.
if (strpos($color, ' ') !== false) {
$colors = explode(' ', $color);
foreach ($colors as $backgroundpart) {
if (substr(trim($backgroundpart), 0, 1) == '#' ||
in_array(trim($backgroundpart), array_keys($this->colornames))) {
$color = $backgroundpart;
}
}
}
}
@@ -296,9 +303,20 @@ class brickfield_accessibility_color_test extends brickfield_accessibility_test
}
// RGB values.
if (strtolower(substr($color, 0, 3)) == 'rgb') {
$colors = explode(',', trim(str_replace('rgb(', '', $color), '()'));
if (count($colors) != 3) {
return false;
if (strpos($color, 'rgba') !== false) {
$tmpbg = $this->get_rgb($this->defaultbackground);
$colors = explode(',', trim(str_replace('rgba(', '', $color), '()'));
if (count($colors) != 4) {
return false;
}
$colors[0] = round(((1 - $colors[3]) * $tmpbg['r']) + ($colors[3] * $colors[0]));
$colors[1] = round((1 - $colors[3]) * $tmpbg['g']) + ($colors[3] * $colors[1]);
$colors[2] = round((1 - $colors[3]) * $tmpbg['b']) + ($colors[3] * $colors[2]);
} else {
$colors = explode(',', trim(str_replace('rgb(', '', $color), '()'));
if (count($colors) != 3) {
return false;
}
}
$r = intval($colors[0]);
$g = intval($colors[1]);
@@ -62,9 +62,18 @@ class css_text_has_contrast extends brickfield_accessibility_color_test {
foreach ($entries as $element) {
$style = $this->css->get_style($element);
if (isset($style['background-color']) || isset($style['color'])) {
if (isset($style['background-color']) || isset($style['color']) || isset($style['background'])) {
if (!isset($style['background-color'])) {
$style['background-color'] = $this->defaultbackground;
if (isset($style['background'])) {
// Parsing background-color from CSS background shortcut string.
$style['background-color'] = '#' . $this->convert_color($style['background']);
// If value is empty after hash, then use defaultbackground.
if ($style['background-color'] == '#') {
$style['background-color'] = $this->defaultbackground;
}
} else {
$style['background-color'] = $this->defaultbackground;
}
}
if (!isset($style['color'])) {
@@ -82,11 +91,7 @@ class css_text_has_contrast extends brickfield_accessibility_color_test {
$style['color'] = '#' . $this->convert_color($style['color']);
$style['background-color'] = '#' . $this->convert_color($background);
if (substr($background, 0, 3) == "rgb") {
$background = '#' . $this->convert_color($background);
}
$luminosity = $this->get_luminosity($style['color'], $background);
$luminosity = $this->get_luminosity($style['color'], $style['background-color']);
$fontsize = 0;
$bold = false;
$italic = false;
@@ -35,7 +35,7 @@ class accessibility_test extends \advanced_testcase {
* @throws \dml_exception
* @throws \moodle_exception
*/
public function test_get_title() {
public function test_get_title(): void {
$this->resetAfterTest();
$object = new accessibility();
$filter = new filter();
@@ -57,7 +57,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_check_ids() {
public function test_check_ids(): void {
$this->resetAfterTest();
$object = new accessibility();
@@ -74,7 +74,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_get_translations() {
public function test_get_translations(): void {
$this->resetAfterTest();
$object = new accessibility();
@@ -90,7 +90,7 @@ class accessibility_test extends \advanced_testcase {
*
* @throws \dml_exception
*/
public function test_get_category_courseids() {
public function test_get_category_courseids(): void {
$this->resetAfterTest();
$object = new accessibility();
$category = $this->getDataGenerator()->create_category();
+4 -4
View File
@@ -32,7 +32,7 @@ class area_test extends area_test_base {
/**
* Test for the area assign intro
*/
public function test_assign() {
public function test_assign(): void {
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();
$assign1 = $this->getDataGenerator()->create_module('assign', array(
@@ -87,7 +87,7 @@ class area_test extends area_test_base {
/**
* Test for the area questiontext
*/
public function test_questiontext() {
public function test_questiontext(): void {
$this->resetAfterTest();
/** @var \core_question_generator $generator */
$generator = $this->getDataGenerator()->get_plugin_generator('core_question');
@@ -147,7 +147,7 @@ class area_test extends area_test_base {
/**
* test for the area questionanswers
*/
public function test_questionanswers() {
public function test_questionanswers(): void {
global $DB;
$this->resetAfterTest();
@@ -191,7 +191,7 @@ class area_test extends area_test_base {
/**
* Test for the areas choice intro and choice options
*/
public function test_choice() {
public function test_choice(): void {
global $DB;
$this->resetAfterTest();
$course = $this->getDataGenerator()->create_course();
+6 -6
View File
@@ -27,7 +27,7 @@ use tool_brickfield\local\tool\filter;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filters_test extends \advanced_testcase {
public function test_constructor() {
public function test_constructor(): void {
$this->resetAfterTest();
// Variables.
@@ -56,7 +56,7 @@ class filters_test extends \advanced_testcase {
$this->assertEquals($object->url, $url);
}
public function test_get_course_sql() {
public function test_get_course_sql(): void {
$this->resetAfterTest();
$object = new filter();
@@ -73,7 +73,7 @@ class filters_test extends \advanced_testcase {
}
public function test_validate_filters() {
public function test_validate_filters(): void {
$this->resetAfterTest();
// Variables.
$courseid = 0;
@@ -102,7 +102,7 @@ class filters_test extends \advanced_testcase {
$this->assertFalse($output);
}
public function test_has_course_filters() {
public function test_has_course_filters(): void {
$this->resetAfterTest();
$object = new filter();
@@ -114,7 +114,7 @@ class filters_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_has_capability_in_context() {
public function test_has_capability_in_context(): void {
global $DB;
$this->resetAfterTest();
@@ -151,7 +151,7 @@ class filters_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_get_errormessage() {
public function test_get_errormessage(): void {
$this->resetAfterTest();
// Variables.
$courseid = 0;
@@ -36,7 +36,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find course areas.
*/
public function test_find_course_areas() {
public function test_find_course_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -122,7 +122,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find relevant areas.
*/
public function test_find_relevant_areas() {
public function test_find_relevant_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -153,7 +153,7 @@ class questionanswers_test extends \advanced_testcase {
/**
* Test find system areas.
*/
public function test_find_system_areas() {
public function test_find_system_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -42,7 +42,7 @@ class questiontext_test extends area_test_base {
/**
* Test find course areas.
*/
public function test_find_course_areas() {
public function test_find_course_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -126,7 +126,7 @@ class questiontext_test extends area_test_base {
/**
* Test find relevant areas.
*/
public function test_find_relevant_areas() {
public function test_find_relevant_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -156,7 +156,7 @@ class questiontext_test extends area_test_base {
/**
* Test find system areas.
*/
public function test_find_system_areas() {
public function test_find_system_areas(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -197,7 +197,7 @@ class questiontext_test extends area_test_base {
*
* @covers ::get_course_and_category
*/
public function test_get_course_and_category() {
public function test_get_course_and_category(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -103,7 +103,7 @@ EOD;
/**
* Test for links opening a new tab or window
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'a');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for anchor tags containing text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'a');
@@ -90,7 +90,7 @@ EOD;
/**
* Test for anchor tags not containing susplicious link text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
@@ -103,7 +103,7 @@ EOD;
/**
* Test Area tags opening new window without warning
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'area');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for area tags containing an alt value
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'area');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for basefont tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'basefont');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for blink tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'blink');
@@ -65,7 +65,7 @@ EOD;
/**
* Test for b tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'b');
$this->assertTrue($results[1]->element->tagName == 'b');
@@ -124,7 +124,7 @@ EOD;
/**
* Test for checking the length of the content
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->message == '<p id=\'wc\'>Word Count: 578</p>');
@@ -30,6 +30,7 @@ require_once('all_checks.php');
/**
* Class test_css_text_has_contrast_test
* @covers \tool_brickfield\local\htmlchecker\brickfield_accessibility
*/
class css_text_has_contrast_test extends all_checks {
/** @var string The check type. */
@@ -229,7 +230,7 @@ EOD;
/**
* Test for the area assign intro
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'p');
@@ -255,7 +256,7 @@ EOD;
/**
* Test with valid colour names.
*/
public function test_check_for_namedcolours() {
public function test_check_for_namedcolours(): void {
$results = $this->get_checker_results($this->namecolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -263,7 +264,7 @@ EOD;
/**
* Test with invalid colour names.
*/
public function test_check_for_invalidcolours() {
public function test_check_for_invalidcolours(): void {
$results = $this->get_checker_results($this->invalidcolours);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -271,7 +272,7 @@ EOD;
/**
* Test with invalid colour numeric values.
*/
public function test_check_for_invalidvalues() {
public function test_check_for_invalidvalues(): void {
$results = $this->get_checker_results($this->invalidvalue);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -279,7 +280,7 @@ EOD;
/**
* Test with empty colour values.
*/
public function test_check_for_emptyvalues() {
public function test_check_for_emptyvalues(): void {
$results = $this->get_checker_results($this->emptyvalue);
$this->assertEmpty($results);
}
@@ -287,7 +288,7 @@ EOD;
/**
* Test for text px18 with insufficient contrast of 4.49.
*/
public function test_check_for_px18_fail() {
public function test_check_for_px18_fail(): void {
$results = $this->get_checker_results($this->px18);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -295,7 +296,7 @@ EOD;
/**
* Test for text px19 bold with sufficient contrast of 4.49.
*/
public function test_check_for_px19bold_pass() {
public function test_check_for_px19bold_pass(): void {
$results = $this->get_checker_results($this->px19bold);
$this->assertEmpty($results);
}
@@ -303,7 +304,7 @@ EOD;
/**
* Test for text px18 with sufficient contrast of 4.81.
*/
public function test_check_for_px18_pass() {
public function test_check_for_px18_pass(): void {
$results = $this->get_checker_results($this->px18pass);
$this->assertEmpty($results);
}
@@ -311,7 +312,7 @@ EOD;
/**
* Test for medium (12pt) text with insufficient contrast of 4.49.
*/
public function test_check_for_medium_fail() {
public function test_check_for_medium_fail(): void {
$results = $this->get_checker_results($this->mediumfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -319,7 +320,7 @@ EOD;
/**
* Test for medium (12pt) text with sufficient contrast of 4.81.
*/
public function test_check_for_medium_pass() {
public function test_check_for_medium_pass(): void {
$results = $this->get_checker_results($this->mediumpass);
$this->assertEmpty($results);
}
@@ -327,7 +328,7 @@ EOD;
/**
* Test for larger (14pt) text with insufficient contrast of 2.94.
*/
public function test_check_for_larger_fail() {
public function test_check_for_larger_fail(): void {
$results = $this->get_checker_results($this->largerfail);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -335,7 +336,7 @@ EOD;
/**
* Test for larger (14pt) text with insufficient contrast of 3.02.
*/
public function test_check_for_larger_pass() {
public function test_check_for_larger_pass(): void {
$results = $this->get_checker_results($this->largerpass);
$this->assertTrue($results[0]->element->tagName == 'p');
}
@@ -343,8 +344,118 @@ EOD;
/**
* Test for larger (14pt) bold text with sufficient contrast of 3.02.
*/
public function test_check_for_largerbold_pass() {
public function test_check_for_largerbold_pass(): void {
$results = $this->get_checker_results($this->largerboldpass);
$this->assertEmpty($results);
}
/**
* Test for rgb colors with insufficient contrast.
*/
public function test_bad_rgbcolor(): void {
$html = '<body><p style="color:rgb(255, 255, 255); background-color:rgb(204, 204, 204);">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for rgb colors with sufficient contrast.
*/
public function test_good_rgbcolor(): void {
$html = '<body><p style="color:rgb(255, 255, 255); background-color:rgb(0, 0, 0);">
This is contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertEmpty($results);
}
/**
* Test for named colors with insufficient contrast.
*/
public function test_bad_namedcolor2(): void {
$html = '<body><p style="color:lightcyan; background-color:lavender;">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for named colors with sufficient contrast.
*/
public function test_good_namedcolor2(): void {
$html = '<body><p style="color:linen; background-color:darkslategray;">
This is contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertEmpty($results);
}
/**
* Test for background value with insufficient contrast.
*/
public function test_bad_backgroundcss(): void {
$html = '<body><p style="color:lightcyan; background:fixed lavender center;">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for background value with sufficient contrast.
*/
public function test_good_backgroundcss(): void {
$html = '<body><p style="color:linen; background:fixed darkslategray center;">
This is contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertEmpty($results);
}
/**
* Test for background value with rgb with insufficient contrast.
*/
public function test_bad_backgroundcssrgb(): void {
$html = '<body><p style="color:rgb(255, 255, 255); background:fixed rgb(204, 204, 204) center;">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for background value with rgb with sufficient contrast.
*/
public function test_good_backgroundcssrgb(): void {
$html = '<body><p style="color:rgb(255, 255, 255); background:fixed rgb(0, 0, 0) center;">
This is contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertEmpty($results);
}
/**
* Test for text with insufficient contrast of 4.3.
*/
public function test_bad_contrastrounding(): void {
$html = '<body><p style="color:#F50000; background-color:white; font-size: 12px">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for background value with rgba with insufficient contrast.
*/
public function test_bad_backgroundcssrgba(): void {
$html = '<body><p style="color:rgba(255, 255, 255, 0.5); background:fixed rgba(0, 204, 204, 0.5) center;">
This is not contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertTrue($results[0]->element->tagName == 'p');
}
/**
* Test for background value with rgba with sufficient contrast.
*/
public function test_good_backgroundcssrgba(): void {
$html = '<body><p style="color:rgba(255, 255, 255, 0.75); background:fixed rgba(0, 0, 0, 0.75) center;">
This is contrasty enough.</p></body>';
$results = $this->get_checker_results($html);
$this->assertEmpty($results);
}
}
@@ -81,7 +81,7 @@ EOD;
/**
* Test for noembed child tags
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'embed');
@@ -122,7 +122,7 @@ EOD;
/**
* Test the header following an h3 must be h1, h2, h3 or h4.
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'h5');
@@ -76,7 +76,7 @@ EOD;
/**
* Test for headers not containing text
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'h2');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for i tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'i');
@@ -64,7 +64,7 @@ EOD;
/**
* Test for img alt attributes matching the src attribute
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');
@@ -68,7 +68,7 @@ EOD;
/**
* Test for image alt attributes being too long
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');
@@ -63,7 +63,7 @@ EOD;
/**
* Test for >Anchor tags containing a nested img tag, must not have an empty alt attribute
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');
@@ -133,7 +133,7 @@ EOD;
/**
* Test for the each en string specified in $strings - line 43 in imgAltNotPlaceHolder.
*/
public function test_failcheck() {
public function test_failcheck(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'img');
@@ -156,7 +156,7 @@ EOD;
/**
* Test with alt that was not specified in the $strings array.
*/
public function test_passcheck1() {
public function test_passcheck1(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
}
@@ -76,7 +76,7 @@ EOD;
/**
* Test for missing image alt text.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'img');
@@ -87,7 +87,7 @@ EOD;
/**
* Test for present image alt text.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertTrue(count($results) == 0);
}
@@ -66,7 +66,7 @@ EOD;
/**
* Test for usemap attribute.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'img');
}
@@ -74,7 +74,7 @@ EOD;
/**
* Test for ismap attribute.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -76,7 +76,7 @@ EOD;
/**
* Test for if legend is empty or only has white spaces.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'legend');
@@ -87,7 +87,7 @@ EOD;
/**
* Test for if legend has text.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -254,7 +254,7 @@ EOD;
/**
* Test for if heading exists where doc length is above 1800
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertNotEmpty($results);
@@ -263,7 +263,7 @@ EOD;
/**
* Test for if marquee does not exist.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
@@ -66,7 +66,7 @@ EOD;
/**
* Test for missing embed element within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@@ -74,7 +74,7 @@ EOD;
/**
* Test for present embed element within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -63,7 +63,7 @@ EOD;
/**
* Test for missing title attribute within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@@ -71,7 +71,7 @@ EOD;
/**
* Test for present title attribute within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -129,7 +129,7 @@ EOD;
/**
* Test that embed element within object element.
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'object');
}
@@ -137,7 +137,7 @@ EOD;
/**
* Test for embed element within object element.
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
@@ -77,7 +77,7 @@ EOD;
/**
* Test for b tags being used
*/
public function test_check() {
public function test_check(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'strike');
@@ -117,7 +117,7 @@ EOD;
/**
* Test that th does not exist
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertTrue($results[0]->element->tagName == 'table');
@@ -128,7 +128,7 @@ EOD;
/**
* Test that th does exist
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
@@ -67,7 +67,7 @@ EOD;
/**
* Test that caption and summary are equal
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail);
$this->assertTrue($results[0]->element->tagName == 'table');
}
@@ -75,7 +75,7 @@ EOD;
/**
* Test that caption and summary are not equal
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -125,7 +125,7 @@ EOD;
/**
* Test for rowspan and colspan
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertNotEmpty($results);
@@ -136,7 +136,7 @@ EOD;
/**
* Test for rowspan and colspan
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass);
$this->assertEmpty($results);
}
@@ -163,7 +163,7 @@ EOD;
/**
* Test that th has scope that is equal to col or row
*/
public function test_check_fail() {
public function test_check_fail(): void {
$results = $this->get_checker_results($this->htmlfail1);
$this->assertEquals(2, count($results));
$this->assertTrue($results[0]->element->tagName == 'th');
@@ -177,7 +177,7 @@ EOD;
/**
* Test that th has scope but != col || row. Test that th has no scope
*/
public function test_check_pass() {
public function test_check_pass(): void {
$results = $this->get_checker_results($this->htmlpass1);
$this->assertEmpty($results);
@@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class activityresults_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new activityresults();
@@ -34,7 +34,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'Activity breakdown summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new activityresults();
@@ -42,7 +42,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'Activity breakdown');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new activityresults();
@@ -50,7 +50,7 @@ class activityresults_test extends \advanced_testcase {
$this->assertEquals($output, 'activityresults');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
@@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class checktyperesults_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@@ -34,7 +34,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'Content types summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@@ -42,7 +42,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'Content types');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new checktyperesults();
@@ -50,7 +50,7 @@ class checktyperesults_test extends \advanced_testcase {
$this->assertEquals($output, 'checktyperesults');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
@@ -26,7 +26,7 @@ namespace tool_brickfield\local\tool;
*/
class errors_test extends \advanced_testcase {
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new errors();
@@ -34,7 +34,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'Error list summary');
}
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new errors();
@@ -42,7 +42,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'Error list');
}
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new errors();
@@ -50,7 +50,7 @@ class errors_test extends \advanced_testcase {
$this->assertEquals($output, 'errors');
}
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
@@ -29,7 +29,7 @@ class printable_test extends \advanced_testcase {
/**
* Test tool name.
*/
public function test_toolname() {
public function test_toolname(): void {
$this->resetAfterTest();
$object = new printable();
@@ -40,7 +40,7 @@ class printable_test extends \advanced_testcase {
/**
* Test tool short name.
*/
public function test_toolshortname() {
public function test_toolshortname(): void {
$this->resetAfterTest();
$object = new printable();
@@ -51,7 +51,7 @@ class printable_test extends \advanced_testcase {
/**
* Test plugin name.
*/
public function test_pluginname() {
public function test_pluginname(): void {
$this->resetAfterTest();
$object = new printable();
@@ -77,7 +77,7 @@ class printable_test extends \advanced_testcase {
/**
* Test get output.
*/
public function test_get_output() {
public function test_get_output(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
+1 -1
View File
@@ -28,7 +28,7 @@ class manager_test extends \advanced_testcase {
/**
* Tests for the function manager::get_all_areas()
*/
public function test_get_areas() {
public function test_get_areas(): void {
$this->resetAfterTest();
$areas = manager::get_all_areas();
$areaclassnames = array_map('get_class', $areas);
@@ -40,7 +40,7 @@ class registration_test extends \advanced_testcase {
* Tests the state of the registration system when first installed.
* @throws \dml_exception
*/
public function test_initial_state() {
public function test_initial_state(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@@ -56,7 +56,7 @@ class registration_test extends \advanced_testcase {
* Test the various states for setting registration keys.
* @throws \dml_exception
*/
public function test_set_keys_for_registration() {
public function test_set_keys_for_registration(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@@ -79,7 +79,7 @@ class registration_test extends \advanced_testcase {
* Test the validation system through its several states.
* @throws \dml_exception
*/
public function test_validation() {
public function test_validation(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@@ -112,7 +112,7 @@ class registration_test extends \advanced_testcase {
* Tests the system after validation grace periods expire.
* @throws \dml_exception
*/
public function test_validation_time_expiry() {
public function test_validation_time_expiry(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
@@ -149,7 +149,7 @@ class registration_test extends \advanced_testcase {
* Tests the system after summary data time periods expire.
* @throws \dml_exception
*/
public function test_summary_time_expiry() {
public function test_summary_time_expiry(): void {
$this->resetAfterTest();
$regobj = new mock_registration();
+19 -19
View File
@@ -26,7 +26,7 @@ namespace tool_brickfield;
*/
class scheduler_test extends \advanced_testcase {
public function test_request_analysis() {
public function test_request_analysis(): void {
$this->resetAfterTest();
// I believe there is a bug where the code won't work with the default constructor values.
@@ -48,7 +48,7 @@ class scheduler_test extends \advanced_testcase {
}
public function test_mark_analyzed() {
public function test_mark_analyzed(): void {
$this->resetAfterTest();
$object = new scheduler();
$output = $object->mark_analyzed();
@@ -59,7 +59,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_create_schedule() {
public function test_create_schedule(): void {
global $DB;
$this->resetAfterTest();
@@ -76,7 +76,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertEquals($record->instanceid, 1);
}
public function test_delete_schedule() {
public function test_delete_schedule(): void {
global $DB;
// Call create_record() to insert a record into the table.
@@ -95,7 +95,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertFalse($record);
}
public function test_is_in_schedule() {
public function test_is_in_schedule(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -109,7 +109,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_scheduled() {
public function test_is_scheduled(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -129,7 +129,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_submitted() {
public function test_is_submitted(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -149,7 +149,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_analyzed() {
public function test_is_analyzed(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -170,14 +170,14 @@ class scheduler_test extends \advanced_testcase {
}
// Can't test because it's a protected function.
public function test_standard_search_params() {
public function test_standard_search_params(): void {
}
// Can't test because it's a protected function.
public function test_get_contextid() {
public function test_get_contextid(): void {
}
public function test_get_datarecord() {
public function test_get_datarecord(): void {
$this->resetAfterTest();
$object = new scheduler();
@@ -200,11 +200,11 @@ class scheduler_test extends \advanced_testcase {
}
// No return statement.
public function test_process_scheduled_requests() {
public function test_process_scheduled_requests(): void {
}
public function test_initialize_schedule() {
public function test_initialize_schedule(): void {
global $DB;
$this->resetAfterTest();
@@ -219,14 +219,14 @@ class scheduler_test extends \advanced_testcase {
$this->assertEquals($record->contextlevel, 20);
}
public function test_request_course_analysis() {
public function test_request_course_analysis(): void {
$this->resetAfterTest();
$output = scheduler::request_course_analysis(1);
$this->assertTrue($output);
}
public function test_create_course_schedule() {
public function test_create_course_schedule(): void {
global $DB;
$this->resetAfterTest();
@@ -237,7 +237,7 @@ class scheduler_test extends \advanced_testcase {
}
public function test_delete_course_schedule() {
public function test_delete_course_schedule(): void {
global $DB;
$this->resetAfterTest();
@@ -251,7 +251,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertFalse($record);
}
public function test_is_course_in_schedule() {
public function test_is_course_in_schedule(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -264,7 +264,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_course_scheduled() {
public function test_is_course_scheduled(): void {
$this->resetAfterTest();
// This should assert to false as no record has been inserted.
@@ -283,7 +283,7 @@ class scheduler_test extends \advanced_testcase {
$this->assertTrue($output);
}
public function test_is_course_analyzed() {
public function test_is_course_analyzed(): void {
$this->resetAfterTest();
$object = new scheduler(10, 1);
+8 -8
View File
@@ -58,7 +58,7 @@ w==" alt="This is a bus." />';
EOF;
public function test_build_all_accessibilitytools() {
public function test_build_all_accessibilitytools(): void {
$tools = tool::build_all_accessibilitytools();
$this->assertEquals($tools['errors']::toolshortname(), 'Error list');
@@ -68,14 +68,14 @@ EOF;
$this->assertEquals($tools['advanced']::toolshortname(), 'Advanced');
}
public function test_data_is_valid() {
public function test_data_is_valid(): void {
$object = $this->getMockForAbstractClass(tool::class);
$object->set_filter(new filter());
$output = $object->data_is_valid();
$this->assertFalse($output);
}
public function test_can_access() {
public function test_can_access(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
$filter = new filter(1, $category->id, 'tab', 3, 4);
@@ -86,14 +86,14 @@ EOF;
$this->assertFalse($output);
}
public function test_get_error_message() {
public function test_get_error_message(): void {
$tool = $this->getMockForAbstractClass(tool::class);
$output = $tool->get_error_message();
$this->assertEquals($output, '');
}
public function test_get_module_label() {
public function test_get_module_label(): void {
$output = tool::get_module_label('core_course');
$this->assertEquals($output, 'Course');
@@ -101,7 +101,7 @@ EOF;
$this->assertEquals($output, 'Book');
}
public function test_toplevel_arguments() {
public function test_toplevel_arguments(): void {
$this->resetAfterTest();
$category = $this->getDataGenerator()->create_category();
$filter = new filter(1, $category->id, 'tab', 3, 4);
@@ -154,14 +154,14 @@ EOF;
* @param string $content
* @param bool $expectation
*/
public function test_base64_img_detected(string $content, bool $expectation) {
public function test_base64_img_detected(string $content, bool $expectation): void {
$this->assertEquals(
$expectation,
tool::base64_img_detected($content)
);
}
public function test_truncate_base64() {
public function test_truncate_base64(): void {
$truncated = tool::truncate_base64($this->base64img);
$this->assertStringContainsString('<img src="data:image/gif;base64..."', $truncated);
}
@@ -44,7 +44,7 @@ class events_test extends \advanced_testcase {
/**
* Test the report viewed event.
*/
public function test_report_viewed() {
public function test_report_viewed(): void {
$event = \tool_capability\event\report_viewed::create();
// Trigger and capture the event.
@@ -36,7 +36,7 @@ class locallib_test extends \advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data() {
public function test_tool_capability_calculate_role_data(): void {
global $DB;
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
@@ -58,7 +58,7 @@ class locallib_test extends \advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data_orphan_contexts() {
public function test_tool_capability_calculate_role_data_orphan_contexts(): void {
global $DB;
$this->resetAfterTest();
+10 -10
View File
@@ -53,7 +53,7 @@ class api_test extends \advanced_testcase {
cohort_add_member($this->cohort->id, $this->userassignover->id);
}
public function test_create_cohort_role_assignment_without_permission() {
public function test_create_cohort_role_assignment_without_permission(): void {
$this->setUser($this->userassignto);
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -64,7 +64,7 @@ class api_test extends \advanced_testcase {
api::create_cohort_role_assignment($params);
}
public function test_create_cohort_role_assignment_with_invalid_data() {
public function test_create_cohort_role_assignment_with_invalid_data(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -75,7 +75,7 @@ class api_test extends \advanced_testcase {
api::create_cohort_role_assignment($params);
}
public function test_create_cohort_role_assignment() {
public function test_create_cohort_role_assignment(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -89,7 +89,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($result->get('cohortid'), $this->cohort->id);
}
public function test_delete_cohort_role_assignment_without_permission() {
public function test_delete_cohort_role_assignment_without_permission(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -102,7 +102,7 @@ class api_test extends \advanced_testcase {
api::delete_cohort_role_assignment($result->get('id'));
}
public function test_delete_cohort_role_assignment_with_invalid_data() {
public function test_delete_cohort_role_assignment_with_invalid_data(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -114,7 +114,7 @@ class api_test extends \advanced_testcase {
api::delete_cohort_role_assignment($result->get('id') + 1);
}
public function test_delete_cohort_role_assignment() {
public function test_delete_cohort_role_assignment(): void {
$this->setAdminUser();
// Create a cohort role assigment.
$params = (object) [
@@ -151,7 +151,7 @@ class api_test extends \advanced_testcase {
/**
* Test case verifying that syncing won't remove role assignments if they are valid for another cohort role assignment.
*/
public function test_delete_cohort_role_assignment_cohorts_having_same_members() {
public function test_delete_cohort_role_assignment_cohorts_having_same_members(): void {
$this->setAdminUser();
// Create 2 cohorts, with a 1 user (user1) present in both,
@@ -203,7 +203,7 @@ class api_test extends \advanced_testcase {
$this->assertContains($user2->id, $removedusers);
}
public function test_list_cohort_role_assignments() {
public function test_list_cohort_role_assignments(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -217,7 +217,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($list[0], $result);
}
public function test_count_cohort_role_assignments() {
public function test_count_cohort_role_assignments(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -230,7 +230,7 @@ class api_test extends \advanced_testcase {
$this->assertEquals($count, 1);
}
public function test_sync_all_cohort_roles() {
public function test_sync_all_cohort_roles(): void {
$this->setAdminUser();
$params = (object) array(
'userid' => $this->userassignto->id,
@@ -51,7 +51,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::get_contexts_for_userid().
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
global $DB;
// Test setup.
@@ -94,7 +94,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::export_user_data().
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
// Test setup.
$user = $this->getDataGenerator()->create_user();
$this->setUser($user);
@@ -144,7 +144,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::delete_data_for_all_users_in_context().
*/
public function test_delete_data_for_all_users_in_context() {
public function test_delete_data_for_all_users_in_context(): void {
global $DB;
// Test setup.
@@ -203,7 +203,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test for provider::delete_data_for_user().
*/
public function test_delete_data_for_user() {
public function test_delete_data_for_user(): void {
global $DB;
// Test setup.
@@ -251,7 +251,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test that only users within a course context are fetched.
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$component = 'tool_cohortroles';
// Create a user.
@@ -293,7 +293,7 @@ class provider_test extends \core_privacy\tests\provider_testcase {
/**
* Test that data for users in approved userlist is deleted.
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
$component = 'tool_cohortroles';
// Create user1.
@@ -156,9 +156,9 @@ class data_request extends persistent {
case api::DATAREQUEST_STATUS_EXPIRED:
$result = true;
break;
// Complete requests are expired if the expiry time has elapsed.
// Complete requests are expired if the expiry time is a positive value, and has elapsed.
case api::DATAREQUEST_STATUS_DOWNLOAD_READY:
$expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
$expiryseconds = (int) get_config('tool_dataprivacy', 'privacyrequestexpiry');
if ($expiryseconds > 0 && time() >= ($request->get('timemodified') + $expiryseconds)) {
$result = true;
}
@@ -179,7 +179,12 @@ class data_request extends persistent {
public static function get_expired_requests($userid = 0) {
global $DB;
$expiryseconds = get_config('tool_dataprivacy', 'privacyrequestexpiry');
// Complete requests are expired if the expiry time is a positive value, and has elapsed.
$expiryseconds = (int) get_config('tool_dataprivacy', 'privacyrequestexpiry');
if ($expiryseconds <= 0) {
return [];
}
$expirytime = strtotime("-{$expiryseconds} second");
$table = self::TABLE;
$sqlwhere = 'type = :export_type AND status = :completestatus AND timemodified <= :expirytime';
+59 -59
View File
@@ -37,7 +37,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_admin() {
public function test_check_can_manage_data_registry_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -49,7 +49,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_default() {
public function test_check_can_manage_data_registry_without_cap_default(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -63,7 +63,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_system() {
public function test_check_can_manage_data_registry_without_cap_system(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -77,7 +77,7 @@ class api_test extends \advanced_testcase {
* Ensure that the check_can_manage_data_registry function fails cap testing when a user without capabilities is
* tested with the default context.
*/
public function test_check_can_manage_data_registry_without_cap_own_user() {
public function test_check_can_manage_data_registry_without_cap_own_user(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -90,7 +90,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::update_request_status().
*/
public function test_update_request_status() {
public function test_update_request_status(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -138,7 +138,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_site_dpos() when there are no users with the DPO role.
*/
public function test_get_site_dpos_no_dpos() {
public function test_get_site_dpos_no_dpos(): void {
$this->resetAfterTest();
$admin = get_admin();
@@ -152,7 +152,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_site_dpos() when there are no users with the DPO role.
*/
public function test_get_site_dpos() {
public function test_get_site_dpos(): void {
global $DB;
$this->resetAfterTest();
@@ -189,7 +189,7 @@ class api_test extends \advanced_testcase {
/**
* Test for \tool_dataprivacy\api::get_assigned_privacy_officer_roles().
*/
public function test_get_assigned_privacy_officer_roles() {
public function test_get_assigned_privacy_officer_roles(): void {
global $DB;
$this->resetAfterTest();
@@ -232,7 +232,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request().
*/
public function test_approve_data_request() {
public function test_approve_data_request(): void {
global $DB;
$this->resetAfterTest();
@@ -276,7 +276,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request() when allow filtering of exports by course.
*/
public function test_approve_data_request_with_allow_filtering() {
public function test_approve_data_request_with_allow_filtering(): void {
global $DB;
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
@@ -325,7 +325,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::approve_data_request() when called by a user who doesn't have the DPO role.
*/
public function test_approve_data_request_non_dpo_user() {
public function test_approve_data_request_non_dpo_user(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -347,7 +347,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::add_request_contexts_with_status().
*/
public function test_add_request_contexts_with_status() {
public function test_add_request_contexts_with_status(): void {
global $DB;
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
@@ -385,7 +385,7 @@ class api_test extends \advanced_testcase {
/**
* Test that deletion requests for the primary admin are rejected
*/
public function test_reject_data_deletion_request_primary_admin() {
public function test_reject_data_deletion_request_primary_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -408,7 +408,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_contact_dpo()
*/
public function test_can_contact_dpo() {
public function test_can_contact_dpo(): void {
$this->resetAfterTest();
// Default ('contactdataprotectionofficer' is disabled by default).
@@ -426,7 +426,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_manage_data_requests()
*/
public function test_can_manage_data_requests() {
public function test_can_manage_data_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -471,7 +471,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has no capability to make any data requests for children cannot create data requests for any
* other user.
*/
public function test_can_create_data_request_for_user_no() {
public function test_can_create_data_request_for_user_no(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -485,7 +485,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_can_create_data_request_for_user_some() {
public function test_can_create_data_request_for_user_some(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -505,7 +505,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_can_create_data_request_for_user_own_child() {
public function test_can_create_data_request_for_user_own_child(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -524,7 +524,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has no capability to make any data requests for children cannot create data requests for any
* other user.
*/
public function test_require_can_create_data_request_for_user_no() {
public function test_require_can_create_data_request_for_user_no(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -539,7 +539,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_require_can_create_data_request_for_user_some() {
public function test_require_can_create_data_request_for_user_some(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -560,7 +560,7 @@ class api_test extends \advanced_testcase {
* Test that a user who has the capability to make any data requests for one other user cannot create data requests
* for any other user.
*/
public function test_require_can_create_data_request_for_user_own_child() {
public function test_require_can_create_data_request_for_user_own_child(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -578,7 +578,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::can_download_data_request_for_user()
*/
public function test_can_download_data_request_for_user() {
public function test_can_download_data_request_for_user(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@@ -700,7 +700,7 @@ class api_test extends \advanced_testcase {
$expectedstatus,
$expectedtaskcount,
$allowfiltering,
) {
): void {
global $USER;
$this->resetAfterTest();
@@ -751,7 +751,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::create_data_request() made by a parent.
*/
public function test_create_data_request_by_parent() {
public function test_create_data_request_by_parent(): void {
global $DB;
$this->resetAfterTest();
@@ -786,7 +786,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::deny_data_request()
*/
public function test_deny_data_request() {
public function test_deny_data_request(): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -841,7 +841,7 @@ class api_test extends \advanced_testcase {
* @param boolean $fetchall Whether to fetch all records.
* @param int[] $statuses Status filters.
*/
public function test_get_data_requests($usertype, $fetchall, $statuses) {
public function test_get_data_requests($usertype, $fetchall, $statuses): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -952,7 +952,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::get_approved_contextlist_collection_for_request.
*/
public function test_get_approved_contextlist_collection_for_request() {
public function test_get_approved_contextlist_collection_for_request(): void {
$this->resetAfterTest();
set_config('allowfiltering', 1, 'tool_dataprivacy');
$this->setAdminUser();
@@ -1021,7 +1021,7 @@ class api_test extends \advanced_testcase {
* @param int $status The request status.
* @param bool $expected The expected result.
*/
public function test_has_ongoing_request($status, $expected) {
public function test_has_ongoing_request($status, $expected): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -1045,7 +1045,7 @@ class api_test extends \advanced_testcase {
* @param int $status The request status
* @param bool $expected The expected result
*/
public function test_is_active($status, $expected) {
public function test_is_active($status, $expected): void {
// Check if this request is ongoing.
$result = api::is_active($status);
$this->assertEquals($expected, $result);
@@ -1054,7 +1054,7 @@ class api_test extends \advanced_testcase {
/**
* Test for api::is_site_dpo()
*/
public function test_is_site_dpo() {
public function test_is_site_dpo(): void {
global $DB;
$this->resetAfterTest();
@@ -1108,7 +1108,7 @@ class api_test extends \advanced_testcase {
* @param string $typestringid The request lang string identifier
* @param string $comments The requestor's message to the DPO.
*/
public function test_notify_dpo($byadmin, $type, $typestringid, $comments) {
public function test_notify_dpo($byadmin, $type, $typestringid, $comments): void {
$this->resetAfterTest();
$generator = new testing_data_generator();
@@ -1150,7 +1150,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_purpose_crud() {
public function test_purpose_crud(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -1192,7 +1192,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_category_crud() {
public function test_category_crud(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -1230,7 +1230,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_context_instances() {
public function test_context_instances(): void {
global $DB;
$this->resetAfterTest();
@@ -1266,7 +1266,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_contextlevel() {
public function test_contextlevel(): void {
global $DB;
$this->resetAfterTest();
@@ -1302,7 +1302,7 @@ class api_test extends \advanced_testcase {
*
* @return null
*/
public function test_effective_contextlevel_defaults() {
public function test_effective_contextlevel_defaults(): void {
$this->setAdminUser();
$this->resetAfterTest();
@@ -1340,7 +1340,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that when nothing is configured, all values return false.
*/
public function test_get_effective_contextlevel_unset() {
public function test_get_effective_contextlevel_unset(): void {
// Before setup, get_effective_contextlevel_purpose will return false.
$this->assertFalse(api::get_effective_contextlevel_category(CONTEXT_SYSTEM));
$this->assertFalse(api::get_effective_contextlevel_purpose(CONTEXT_SYSTEM));
@@ -1352,7 +1352,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that when nothing is configured, all values return false.
*/
public function test_get_effective_context_unset() {
public function test_get_effective_context_unset(): void {
// Before setup, get_effective_contextlevel_purpose will return false.
$this->assertFalse(api::get_effective_context_category(\context_system::instance()));
$this->assertFalse(api::get_effective_context_purpose(\context_system::instance()));
@@ -1364,7 +1364,7 @@ class api_test extends \advanced_testcase {
* @dataProvider invalid_effective_contextlevel_provider
* @param int $contextlevel
*/
public function test_set_contextlevel_invalid_contextlevels($contextlevel) {
public function test_set_contextlevel_invalid_contextlevels($contextlevel): void {
$this->expectException(\coding_exception::class);
api::set_contextlevel((object) [
@@ -1376,7 +1376,7 @@ class api_test extends \advanced_testcase {
/**
* Test effective contextlevel return.
*/
public function test_effective_contextlevel() {
public function test_effective_contextlevel(): void {
$this->resetAfterTest();
// Set the initial purpose and category.
@@ -1424,7 +1424,7 @@ class api_test extends \advanced_testcase {
* @dataProvider invalid_effective_contextlevel_provider
* @param int $contextlevel
*/
public function test_effective_contextlevel_invalid_contextlevels($contextlevel) {
public function test_effective_contextlevel_invalid_contextlevels($contextlevel): void {
$this->resetAfterTest();
$purpose1 = api::create_purpose((object)['name' => 'p1', 'retentionperiod' => 'PT1H', 'lawfulbases' => 'gdpr_art_6_1_a']);
@@ -1454,7 +1454,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that context inheritance works up the context tree.
*/
public function test_effective_context_inheritance() {
public function test_effective_context_inheritance(): void {
$this->resetAfterTest();
$systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);
@@ -1734,7 +1734,7 @@ class api_test extends \advanced_testcase {
* Although it should not be possible to set hard INHERIT values at this level, there may be legacy data which still
* contains this.
*/
public function test_effective_context_inheritance_explicitly_set() {
public function test_effective_context_inheritance_explicitly_set(): void {
$this->resetAfterTest();
$systemdata = $this->create_and_set_purpose_for_contextlevel('PT1S', CONTEXT_SYSTEM);
@@ -1861,7 +1861,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out protected purpose contexts if the the site is properly configured.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_no_site_config() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_no_site_config(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -1903,7 +1903,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out protected purpose contexts if they are already expired.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_expired_protected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_expired_protected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1936,7 +1936,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests does filter out protected purpose contexts which are not expired.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_protected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_protected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1Y');
@@ -1969,7 +1969,7 @@ class api_test extends \advanced_testcase {
/**
* Test that delete requests do not filter out unexpired contexts if they are not protected.
*/
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_unprotected() {
public function test_get_approved_contextlist_collection_for_collection_delete_course_unexpired_unprotected(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1Y');
@@ -2040,7 +2040,7 @@ class api_test extends \advanced_testcase {
* @param bool $foractivity Whether to set defaults for an activity.
* @param bool $override Whether to override instances.
*/
public function test_set_context_defaults($contextlevel, $inheritcategory, $inheritpurpose, $foractivity, $override) {
public function test_set_context_defaults($contextlevel, $inheritcategory, $inheritpurpose, $foractivity, $override): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@@ -2224,7 +2224,7 @@ class api_test extends \advanced_testcase {
/**
* Ensure that the find_ongoing_request_types_for_users only returns requests which are active.
*/
public function test_find_ongoing_request_types_for_users() {
public function test_find_ongoing_request_types_for_users(): void {
$this->resetAfterTest();
// Create users and their requests:.
@@ -2360,7 +2360,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_self_no() {
public function test_can_create_data_deletion_request_for_self_no(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$roleid = $this->getDataGenerator()->create_role();
@@ -2373,7 +2373,7 @@ class api_test extends \advanced_testcase {
/**
* Test primary admin cannot create data deletion request for themselves
*/
public function test_can_create_data_deletion_request_for_self_primary_admin() {
public function test_can_create_data_deletion_request_for_self_primary_admin(): void {
$this->resetAfterTest();
$this->setAdminUser();
$this->assertFalse(api::can_create_data_deletion_request_for_self());
@@ -2382,7 +2382,7 @@ class api_test extends \advanced_testcase {
/**
* Test secondary admin can create data deletion request for themselves
*/
public function test_can_create_data_deletion_request_for_self_secondary_admin() {
public function test_can_create_data_deletion_request_for_self_secondary_admin(): void {
$this->resetAfterTest();
$admin1 = $this->getDataGenerator()->create_user();
@@ -2403,7 +2403,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_self_yes() {
public function test_can_create_data_deletion_request_for_self_yes(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$this->setUser($userid);
@@ -2417,7 +2417,7 @@ class api_test extends \advanced_testcase {
* @throws coding_exception
* @throws dml_exception
*/
public function test_can_create_data_deletion_request_for_other_no() {
public function test_can_create_data_deletion_request_for_other_no(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$this->setUser($userid);
@@ -2430,7 +2430,7 @@ class api_test extends \advanced_testcase {
*
* @throws coding_exception
*/
public function test_can_create_data_deletion_request_for_other_yes() {
public function test_can_create_data_deletion_request_for_other_yes(): void {
$this->resetAfterTest();
$userid = $this->getDataGenerator()->create_user()->id;
$roleid = $this->getDataGenerator()->create_role();
@@ -2448,7 +2448,7 @@ class api_test extends \advanced_testcase {
* @throws coding_exception
* @throws dml_exception
*/
public function test_can_create_data_deletion_request_for_children() {
public function test_can_create_data_deletion_request_for_children(): void {
$this->resetAfterTest();
$parent = $this->getDataGenerator()->create_user();
@@ -2490,7 +2490,7 @@ class api_test extends \advanced_testcase {
* @dataProvider queue_data_request_task_provider
* @param bool $withuserid
*/
public function test_queue_data_request_task(bool $withuserid) {
public function test_queue_data_request_task(bool $withuserid): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -2546,7 +2546,7 @@ class api_test extends \advanced_testcase {
* @param bool $value The setting's value.
* @param bool $expected The expected result.
*/
public function test_is_automatic_request_approval_on($setting, $type, $value, $expected) {
public function test_is_automatic_request_approval_on($setting, $type, $value, $expected): void {
$this->resetAfterTest();
if ($value !== null) {
@@ -2713,7 +2713,7 @@ class api_test extends \advanced_testcase {
/**
* Test api validate_create_data_request.
*/
public function test_validate_create_data_request() {
public function test_validate_create_data_request(): void {
$this->resetAfterTest();
$systemcontext = \context_system::instance();
@@ -54,6 +54,7 @@ Feature: Data delete from the privacy API
And I should see "Awaiting approval" in the "Victim User 1" "table_row"
And I open the action menu in "Victim User 1" "table_row"
And I follow "Approve request"
And I wait until "Approve request" "button" exists
And I press "Approve request"
And I should see "Approved" in the "Victim User 1" "table_row"
And I run all adhoc tasks
@@ -80,6 +81,7 @@ Feature: Data delete from the privacy API
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I open the action menu in "Victim User 1" "table_row"
And I follow "Approve request"
And I wait until "Approve request" "button" exists
And I press "Approve request"
And I log out
@@ -115,6 +117,7 @@ Feature: Data delete from the privacy API
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I open the action menu in "Victim User 1" "table_row"
And I follow "Approve request"
And I wait until "Approve request" "button" exists
And I press "Approve request"
And I log out
@@ -48,6 +48,7 @@ Feature: Data export from the privacy API
And I should see "Awaiting approval" in the "Victim User 1" "table_row"
And I open the action menu in "Victim User 1" "table_row"
And I follow "Approve request"
And I wait until "Approve request" "button" exists
And I press "Approve request"
And I should see "Approved" in the "Victim User 1" "table_row"
And I run all adhoc tasks
@@ -115,6 +116,7 @@ Feature: Data export from the privacy API
And I navigate to "Users > Privacy and policies > Data requests" in site administration
And I open the action menu in "Victim User 1" "table_row"
And I follow "Approve request"
And I wait until "Approve request" "button" exists
And I press "Approve request"
And I log out
@@ -185,7 +187,7 @@ Feature: Data export from the privacy API
And I reload the page
And I should see "Download ready" in the "Victim User 1" "table_row"
And I open the action menu in "Victim User 1" "table_row"
And following "Download" should download between "1" and "170000" bytes
And following "Download" should download between "1" and "172000" bytes
And the following config values are set as admin:
| privacyrequestexpiry | 1 | tool_dataprivacy |
And I wait "1" seconds
@@ -30,7 +30,7 @@ class data_registry_test extends \advanced_testcase {
*
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_context_value_invalid_element() {
public function test_get_effective_context_value_invalid_element(): void {
$this->expectException(\coding_exception::class);
data_registry::get_effective_context_value(\context_system::instance(), 'invalid');
}
@@ -40,7 +40,7 @@ class data_registry_test extends \advanced_testcase {
*
* This test is not great because we only test a limited set of values. This is a fault of the underlying API.
*/
public function test_get_effective_contextlevel_value_invalid_element() {
public function test_get_effective_contextlevel_value_invalid_element(): void {
$this->expectException(\coding_exception::class);
data_registry::get_effective_contextlevel_value(\context_system::instance(), 'invalid');
}
@@ -93,7 +93,7 @@ class data_request_test extends data_privacy_testcase {
* @param bool $resettable
* @param bool $active
*/
public function test_pseudo_states_export(int $status, bool $resettable, bool $active) {
public function test_pseudo_states_export(int $status, bool $resettable, bool $active): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_EXPORT);
@@ -110,7 +110,7 @@ class data_request_test extends data_privacy_testcase {
* @param bool $resettable
* @param bool $active
*/
public function test_pseudo_states_delete(int $status, bool $resettable, bool $active) {
public function test_pseudo_states_delete(int $status, bool $resettable, bool $active): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_DELETE);
@@ -125,7 +125,7 @@ class data_request_test extends data_privacy_testcase {
* @dataProvider status_state_provider
* @param int $status
*/
public function test_can_reset_others($status) {
public function test_can_reset_others($status): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
$uut->set('type', api::DATAREQUEST_TYPE_OTHERS);
@@ -155,7 +155,7 @@ class data_request_test extends data_privacy_testcase {
* @dataProvider non_resettable_provider
* @param int $status
*/
public function test_non_resubmit_request($status) {
public function test_non_resubmit_request($status): void {
$uut = new \tool_dataprivacy\data_request();
$uut->set('status', $status);
@@ -168,7 +168,7 @@ class data_request_test extends data_privacy_testcase {
/**
* Ensure that a rejected request can be reset.
*/
public function test_resubmit_request() {
public function test_resubmit_request(): void {
$this->resetAfterTest();
$uut = new \tool_dataprivacy\data_request();
@@ -192,7 +192,7 @@ class data_request_test extends data_privacy_testcase {
/**
* Ensure that an active request can be reset.
*/
public function test_resubmit_active_request() {
public function test_resubmit_active_request(): void {
$this->resetAfterTest();
$uut = new \tool_dataprivacy\data_request();
@@ -90,7 +90,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_flag_not_setup() {
public function test_flag_not_setup(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -111,7 +111,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_flag_user_no_lastaccess() {
public function test_flag_user_no_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -134,7 +134,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_recent_lastaccess() {
public function test_flag_user_recent_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -157,7 +157,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past is flagged for deletion.
*/
public function test_flag_user_past_lastaccess() {
public function test_flag_user_past_lastaccess(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -181,7 +181,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past but active enrolments is not flagged for deletion.
*/
public function test_flag_user_past_lastaccess_still_enrolled() {
public function test_flag_user_past_lastaccess_still_enrolled(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -209,7 +209,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and no active enrolments is flagged for deletion.
*/
public function test_flag_user_update_existing() {
public function test_flag_user_update_existing(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P5Y');
@@ -241,7 +241,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_lastaccess_unexpired_past_enrolment() {
public function test_flag_user_past_lastaccess_unexpired_past_enrolment(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P1Y');
@@ -269,7 +269,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_override_role() {
public function test_flag_user_past_override_role(): void {
global $DB;
$this->resetAfterTest();
@@ -303,7 +303,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a lastaccess in the past and expired enrolments.
*/
public function test_flag_user_past_lastaccess_expired_enrolled() {
public function test_flag_user_past_lastaccess_expired_enrolled(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -332,7 +332,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a user with a lastaccess in the past and enrolments without a course end date are respected
* correctly.
*/
public function test_flag_user_past_lastaccess_missing_enddate_required() {
public function test_flag_user_past_lastaccess_missing_enddate_required(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -364,7 +364,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a user with a lastaccess in the past and enrolments without a course end date are respected
* correctly when the end date is not required.
*/
public function test_flag_user_past_lastaccess_missing_enddate_not_required() {
public function test_flag_user_past_lastaccess_missing_enddate_not_required(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -395,7 +395,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_recent_lastaccess_existing_record() {
public function test_flag_user_recent_lastaccess_existing_record(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -429,7 +429,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a recent lastaccess is not flagged for deletion.
*/
public function test_flag_user_retention_changed() {
public function test_flag_user_retention_changed(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -469,7 +469,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a historically expired expired block record child is cleaned up.
*/
public function test_flag_user_historic_block_unapproved() {
public function test_flag_user_historic_block_unapproved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -506,7 +506,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a block which has a default retention period which has not expired, is still expired.
*/
public function test_flag_user_historic_unexpired_child() {
public function test_flag_user_historic_unexpired_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -534,7 +534,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with no end date is not flagged.
*/
public function test_flag_course_no_enddate() {
public function test_flag_course_no_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -553,7 +553,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past, but a child which is unexpired is not flagged.
*/
public function test_flag_course_past_enddate_future_child() {
public function test_flag_course_past_enddate_future_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'P5Y');
@@ -575,7 +575,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged.
*/
public function test_flag_course_past_enddate() {
public function test_flag_course_past_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -597,7 +597,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged.
*/
public function test_flag_course_past_enddate_multiple() {
public function test_flag_course_past_enddate_multiple(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -625,7 +625,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the future is not flagged.
*/
public function test_flag_course_future_enddate() {
public function test_flag_course_future_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -644,7 +644,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the future is not flagged.
*/
public function test_flag_course_recent_unexpired_enddate() {
public function test_flag_course_recent_unexpired_enddate(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -662,7 +662,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged, taking into account any purpose override
*/
public function test_flag_course_past_enddate_with_override_unexpired_role() {
public function test_flag_course_past_enddate_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@@ -701,7 +701,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course with an end date in the distant past is flagged, and any expired role is ignored.
*/
public function test_flag_course_past_enddate_with_override_expired_role() {
public function test_flag_course_past_enddate_with_override_expired_role(): void {
global $DB;
$this->resetAfterTest();
@@ -740,7 +740,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that where a course has explicitly expired one role, but that role is explicitly not expired in a child
* context, does not have the parent context role expired.
*/
public function test_flag_course_override_expiredwith_override_unexpired_on_child() {
public function test_flag_course_override_expiredwith_override_unexpired_on_child(): void {
global $DB;
$this->resetAfterTest();
@@ -809,7 +809,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the user has any unexpired roles.
*/
public function test_process_user_context_with_override_unexpired_role() {
public function test_process_user_context_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@@ -867,7 +867,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate unexpiredroles kept.
*/
public function test_process_course_context_with_override_unexpired_role() {
public function test_process_course_context_with_override_unexpired_role(): void {
global $DB;
$this->resetAfterTest();
@@ -955,7 +955,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_override_expired_role() {
public function test_process_course_context_with_override_expired_role(): void {
global $DB;
$this->resetAfterTest();
@@ -1043,7 +1043,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_user_in_both_lists() {
public function test_process_course_context_with_user_in_both_lists(): void {
global $DB;
$this->resetAfterTest();
@@ -1132,7 +1132,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a module context previously flagged as approved is removed with appropriate expiredroles kept.
*/
public function test_process_course_context_with_user_in_both_lists_expired() {
public function test_process_course_context_with_user_in_both_lists_expired(): void {
global $DB;
$this->resetAfterTest();
@@ -1228,7 +1228,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a site not setup will not process anything.
*/
public function test_process_not_setup() {
public function test_process_not_setup(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user(['lastaccess' => time() - YEARSECS]);
@@ -1265,7 +1265,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_process_none_approved() {
public function test_process_none_approved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1304,7 +1304,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with no lastaccess is not flagged for deletion.
*/
public function test_process_no_context() {
public function test_process_no_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1343,7 +1343,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is removed.
*/
public function test_process_user_context() {
public function test_process_user_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1405,7 +1405,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a course context previously flagged as approved is removed.
*/
public function test_process_course_context() {
public function test_process_course_context(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1450,7 +1450,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the user then logs in.
*/
public function test_process_user_context_logged_in_after_approval() {
public function test_process_user_context_logged_in_after_approval(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1502,7 +1502,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user context previously flagged as approved is not removed if the purpose has changed.
*/
public function test_process_user_context_changed_after_approved() {
public function test_process_user_context_changed_after_approved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1554,7 +1554,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a historically expired expired block record child is cleaned up.
*/
public function test_process_user_historic_block_unapproved() {
public function test_process_user_historic_block_unapproved(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1613,7 +1613,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that a user with a block which has a default retention period which has not expired, is still expired.
*/
public function test_process_user_historic_unexpired_child() {
public function test_process_user_historic_unexpired_child(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H');
@@ -1667,7 +1667,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_updated() {
public function test_process_course_context_updated(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1718,7 +1718,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_outstanding_children() {
public function test_process_course_context_outstanding_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1767,7 +1767,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_pending_children() {
public function test_process_course_context_pending_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1825,7 +1825,7 @@ class expired_contexts_test extends \advanced_testcase {
* Ensure that a course context previously flagged as approved for deletion which now has an unflagged child, is
* updated.
*/
public function test_process_course_context_approved_children() {
public function test_process_course_context_approved_children(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -1903,7 +1903,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param int $status
* @param bool $expected
*/
public function test_can_process_deletion($status, $expected) {
public function test_can_process_deletion($status, $expected): void {
$purpose = new expired_context(0, (object) [
'status' => $status,
@@ -1942,7 +1942,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param int $status
* @param bool $expected
*/
public function test_is_complete($status, $expected) {
public function test_is_complete($status, $expected): void {
$purpose = new expired_context(0, (object) [
'status' => $status,
'contextid' => \context_system::instance()->id,
@@ -1980,7 +1980,7 @@ class expired_contexts_test extends \advanced_testcase {
* @param array $record
* @param bool $expected
*/
public function test_is_fully_expired($record, $expected) {
public function test_is_fully_expired($record, $expected): void {
$purpose = new expired_context(0, (object) $record);
$this->assertEquals($expected, $purpose->is_fully_expired());
@@ -2022,7 +2022,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that any orphaned records are removed once the context has been removed.
*/
public function test_orphaned_records_are_cleared() {
public function test_orphaned_records_are_cleared(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'PT1H', 'PT1H');
@@ -2073,7 +2073,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that the progres tracer works as expected out of the box.
*/
public function test_progress_tracer_default() {
public function test_progress_tracer_default(): void {
$manager = new \tool_dataprivacy\expired_contexts_manager();
$rc = new \ReflectionClass(\tool_dataprivacy\expired_contexts_manager::class);
@@ -2085,7 +2085,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that the progres tracer works as expected when given a specific traer.
*/
public function test_progress_tracer_set() {
public function test_progress_tracer_set(): void {
$manager = new \tool_dataprivacy\expired_contexts_manager();
$mytrace = new \null_progress_trace();
$manager->set_progress($mytrace);
@@ -2164,7 +2164,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with the system context.
*/
public function test_is_context_expired_system() {
public function test_is_context_expired_system(): void {
$this->resetAfterTest();
$this->setup_basics('PT1H', 'PT1H', 'P1D');
$user = $this->getDataGenerator()->create_user(['lastaccess' => time() - YEARSECS]);
@@ -2180,7 +2180,7 @@ class expired_contexts_test extends \advanced_testcase {
* Children of a user context always follow the user expiry rather than any context level defaults (e.g. at the
* block level.
*/
public function test_is_context_expired_user_block() {
public function test_is_context_expired_user_block(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@@ -2205,7 +2205,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with the front page course.
*/
public function test_is_context_expired_frontpage() {
public function test_is_context_expired_frontpage(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@@ -2239,7 +2239,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course.
*/
public function test_is_context_expired_course_expired() {
public function test_is_context_expired_course_expired(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@@ -2262,7 +2262,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course.
*/
public function test_is_context_expired_course_unexpired() {
public function test_is_context_expired_course_unexpired(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D');
@@ -2291,7 +2291,7 @@ class expired_contexts_test extends \advanced_testcase {
* If the course is still within the expiry period for the child context, then that child's protected flag should be
* respected, even when the course may have expired.
*/
public function test_is_child_context_expired_course_unexpired_with_child() {
public function test_is_child_context_expired_course_unexpired_with_child(): void {
$this->resetAfterTest();
$purposes = $this->setup_basics('PT1H', 'PT1H', 'P1D', 'P1D');
@@ -2321,7 +2321,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override() {
public function test_is_context_expired_course_expired_override(): void {
global $DB;
$this->resetAfterTest();
@@ -2356,7 +2356,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an expired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_parent() {
public function test_is_context_expired_course_expired_override_parent(): void {
global $DB;
$this->resetAfterTest();
@@ -2405,7 +2405,7 @@ class expired_contexts_test extends \advanced_testcase {
* Test the is_context_expired functions when supplied with an expired course which has role overrides but the user
* does not hold the role.
*/
public function test_is_context_expired_course_expired_override_parent_no_role() {
public function test_is_context_expired_course_expired_override_parent_no_role(): void {
global $DB;
$this->resetAfterTest();
@@ -2434,7 +2434,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse() {
public function test_is_context_expired_course_expired_override_inverse(): void {
global $DB;
$this->resetAfterTest();
@@ -2463,7 +2463,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse_parent() {
public function test_is_context_expired_course_expired_override_inverse_parent(): void {
global $DB;
$this->resetAfterTest();
@@ -2496,7 +2496,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Test the is_context_expired functions when supplied with an unexpired course which has role overrides.
*/
public function test_is_context_expired_course_expired_override_inverse_parent_not_assigned() {
public function test_is_context_expired_course_expired_override_inverse_parent_not_assigned(): void {
global $DB;
$this->resetAfterTest();
@@ -2528,7 +2528,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that context expired checks for a specific user taken into account roles.
*/
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected() {
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected(): void {
global $DB;
$this->resetAfterTest();
@@ -2583,7 +2583,7 @@ class expired_contexts_test extends \advanced_testcase {
/**
* Ensure that context expired checks for a specific user taken into account roles when retention is inversed.
*/
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected_inverse() {
public function test_is_context_expired_or_unprotected_for_user_role_mixtures_protected_inverse(): void {
global $DB;
$this->resetAfterTest();
@@ -26,10 +26,11 @@ require_once('data_privacy_testcase.php');
* Expired data requests tests.
*
* @package tool_dataprivacy
* @covers \tool_dataprivacy\data_request
* @copyright 2018 Michael Hawkins
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class expired_data_requests_test extends data_privacy_testcase {
final class expired_data_requests_test extends data_privacy_testcase {
/**
* Test tearDown.
@@ -41,7 +42,7 @@ class expired_data_requests_test extends data_privacy_testcase {
/**
* Test finding and deleting expired data requests
*/
public function test_data_request_expiry() {
public function test_data_request_expiry(): void {
global $DB;
$this->resetAfterTest();
\core_privacy\local\request\writer::setup_real_writer_instance();
@@ -107,12 +108,58 @@ class expired_data_requests_test extends data_privacy_testcase {
$this->assertEquals(0, $DB->count_records('files', $fileconditions));
}
/**
* Test that data requests are not expired when expiration is disabled (set to zero)
*/
public function test_data_request_expiry_never(): void {
global $DB;
$this->resetAfterTest();
\core_privacy\local\request\writer::setup_real_writer_instance();
// Disable request expiry.
set_config('privacyrequestexpiry', 0, 'tool_dataprivacy');
// Create and approve data request.
$user = $this->getDataGenerator()->create_user();
$usercontext = \context_user::instance($user->id);
$this->setUser($user->id);
$datarequest = api::create_data_request($user->id, api::DATAREQUEST_TYPE_EXPORT);
$requestid = $datarequest->get('id');
$this->setAdminUser();
api::approve_data_request($requestid);
ob_start();
$this->runAdhocTasks('\tool_dataprivacy\task\process_data_request_task');
ob_end_clean();
// Run expiry deletion - should not affect test export.
$expiredrequests = data_request::get_expired_requests();
$this->assertEmpty($expiredrequests);
data_request::expire($expiredrequests);
// Confirm approved and exported.
$request = new data_request($requestid);
$this->assertEquals(api::DATAREQUEST_STATUS_DOWNLOAD_READY, $request->get('status'));
$fileconditions = [
'userid' => $user->id,
'component' => 'tool_dataprivacy',
'filearea' => 'export',
'itemid' => $requestid,
'contextid' => $usercontext->id,
];
$this->assertEquals(2, $DB->count_records('files', $fileconditions));
}
/**
* Test for \tool_dataprivacy\data_request::is_expired()
* Tests for the expected request status to protect from false positive/negative,
* then tests is_expired() is returning the expected response.
*/
public function test_is_expired() {
public function test_is_expired(): void {
$this->resetAfterTest();
\core_privacy\local\request\writer::setup_real_writer_instance();
+47 -47
View File
@@ -48,7 +48,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() with the user not logged in.
*/
public function test_approve_data_request_not_logged_in() {
public function test_approve_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -69,7 +69,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() with the user not having a DPO role.
*/
public function test_approve_data_request_not_dpo() {
public function test_approve_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -89,7 +89,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() for request that's not ready for approval
*/
public function test_approve_data_request_not_waiting_for_approval() {
public function test_approve_data_request_not_waiting_for_approval(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -110,7 +110,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request()
*/
public function test_approve_data_request() {
public function test_approve_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -133,7 +133,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::approve_data_request() for a non-existent request ID.
*/
public function test_approve_data_request_non_existent() {
public function test_approve_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@@ -151,7 +151,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::cancel_data_request() of another user.
*/
public function test_cancel_data_request_other_user() {
public function test_cancel_data_request_other_user(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -177,7 +177,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_other_user_as_requester() {
public function test_cancel_data_request_other_user_as_requester(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -204,7 +204,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_requester_lost_permissions() {
public function test_cancel_data_request_requester_lost_permissions(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -233,7 +233,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test cancellation of a request where you are the requester of another user's data.
*/
public function test_cancel_data_request_other_user_as_child() {
public function test_cancel_data_request_other_user_as_child(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -260,7 +260,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::cancel_data_request()
*/
public function test_cancel_data_request() {
public function test_cancel_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -283,7 +283,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test contact DPO.
*/
public function test_contact_dpo() {
public function test_contact_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -300,7 +300,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test contact DPO with message containing invalid input.
*/
public function test_contact_dpo_with_nasty_input() {
public function test_contact_dpo_with_nasty_input(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -314,7 +314,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() with the user not logged in.
*/
public function test_deny_data_request_not_logged_in() {
public function test_deny_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -334,7 +334,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() with the user not having a DPO role.
*/
public function test_deny_data_request_not_dpo() {
public function test_deny_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -353,7 +353,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() for request that's not ready for approval
*/
public function test_deny_data_request_not_waiting_for_approval() {
public function test_deny_data_request_not_waiting_for_approval(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -373,7 +373,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request()
*/
public function test_deny_data_request() {
public function test_deny_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -395,7 +395,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::deny_data_request() for a non-existent request ID.
*/
public function test_deny_data_request_non_existent() {
public function test_deny_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@@ -412,7 +412,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() with the user not logged in.
*/
public function test_get_data_request_not_logged_in() {
public function test_get_data_request_not_logged_in(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -430,7 +430,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() with the user not having a DPO role.
*/
public function test_get_data_request_not_dpo() {
public function test_get_data_request_not_dpo(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -450,7 +450,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request()
*/
public function test_get_data_request() {
public function test_get_data_request(): void {
$this->resetAfterTest();
$generator = new \testing_data_generator();
@@ -475,7 +475,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_request() for a non-existent request ID.
*/
public function test_get_data_request_non_existent() {
public function test_get_data_request_non_existent(): void {
$this->resetAfterTest();
// Admin as DPO. (The default when no one's assigned as a DPO in the site).
@@ -488,7 +488,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::set_context_defaults()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_set_context_defaults_no_capability() {
public function test_set_context_defaults_no_capability(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
@@ -508,7 +508,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $modulelevel Whether defaults are to be applied on the module context level or for an activity only.
* @param bool $override Whether to override instances.
*/
public function test_set_context_defaults($modulelevel, $override) {
public function test_set_context_defaults($modulelevel, $override): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -567,7 +567,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::get_category_options()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_get_category_options_no_capability() {
public function test_get_category_options_no_capability(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -596,7 +596,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $includeinherit Whether "Inherit" would be included to the options.
* @param bool $includenotset Whether "Not set" would be included to the options.
*/
public function test_get_category_options($includeinherit, $includenotset) {
public function test_get_category_options($includeinherit, $includenotset): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -642,7 +642,7 @@ class external_test extends externallib_advanced_testcase {
* Test for \tool_dataprivacy\external::get_purpose_options()
* when called by a user that doesn't have the manage registry capability.
*/
public function test_get_purpose_options_no_capability() {
public function test_get_purpose_options_no_capability(): void {
$this->resetAfterTest();
$generator = $this->getDataGenerator();
$user = $generator->create_user();
@@ -658,7 +658,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $includeinherit Whether "Inherit" would be included to the options.
* @param bool $includenotset Whether "Not set" would be included to the options.
*/
public function test_get_purpose_options($includeinherit, $includenotset) {
public function test_get_purpose_options($includeinherit, $includenotset): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -726,7 +726,7 @@ class external_test extends externallib_advanced_testcase {
* @param bool $inheritpurpose Whether the purpose would be set to "Inherit".
* @param bool $nodefaults Whether to fetch only activities that don't have defaults.
*/
public function test_get_activity_options($inheritcategory, $inheritpurpose, $nodefaults) {
public function test_get_activity_options($inheritcategory, $inheritpurpose, $nodefaults): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -774,7 +774,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_approve_data_requests().
*/
public function test_bulk_approve_data_requests() {
public function test_bulk_approve_data_requests(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -802,7 +802,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_approve_data_requests() for a non-existent request ID.
*/
public function test_bulk_approve_data_requests_non_existent() {
public function test_bulk_approve_data_requests_non_existent(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -820,7 +820,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_approve_data_requests_no_permission() {
public function test_bulk_approve_data_requests_no_permission(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -849,7 +849,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_approve_data_requests_own_request() {
public function test_bulk_approve_data_requests_own_request(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -877,7 +877,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests().
*/
public function test_bulk_deny_data_requests() {
public function test_bulk_deny_data_requests(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -905,7 +905,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a non-existent request ID.
*/
public function test_bulk_deny_data_requests_non_existent() {
public function test_bulk_deny_data_requests_non_existent(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -922,7 +922,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user without permission to deny requests.
*/
public function test_bulk_deny_data_requests_no_permission() {
public function test_bulk_deny_data_requests_no_permission(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -951,7 +951,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::bulk_deny_data_requests() for a user cannot approve their own request.
*/
public function test_bulk_deny_data_requests_own_request() {
public function test_bulk_deny_data_requests_own_request(): void {
$this->resetAfterTest();
// Create delete data requests.
@@ -986,7 +986,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_using_non_identity() {
public function test_get_users_using_using_non_identity(): void {
$this->resetAfterTest();
$context = \context_system::instance();
$requester = $this->getDataGenerator()->create_user();
@@ -1021,7 +1021,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_identity_without_permission() {
public function test_get_users_using_identity_without_permission(): void {
global $CFG;
$this->resetAfterTest();
@@ -1053,7 +1053,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users_using_field_not_in_identity() {
public function test_get_users_using_field_not_in_identity(): void {
$this->resetAfterTest();
$context = \context_system::instance();
@@ -1082,7 +1082,7 @@ class external_test extends externallib_advanced_testcase {
* @throws required_capability_exception
* @throws restricted_context_exception
*/
public function test_get_users() {
public function test_get_users(): void {
global $CFG;
$this->resetAfterTest();
$CFG->showuseridentity = 'institution';
@@ -1118,7 +1118,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_access_information().
*/
public function test_get_access_information() {
public function test_get_access_information(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -1145,7 +1145,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request()
*/
public function test_create_data_request() {
public function test_create_data_request(): void {
$this->resetAfterTest();
$systemcontext = \context_system::instance();
@@ -1200,7 +1200,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() when no dpo available.
*/
public function test_create_data_request_no_dpo() {
public function test_create_data_request_no_dpo(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -1214,7 +1214,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() with missing permission.
*/
public function test_create_data_request_no_permission() {
public function test_create_data_request_no_permission(): void {
$this->resetAfterTest();
// Enable contact DPO.
@@ -1231,7 +1231,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::create_data_request() with invalid request type.
*/
public function test_create_data_request_invalid_type() {
public function test_create_data_request_invalid_type(): void {
$this->resetAfterTest();
// Enable contact DPO.
@@ -1248,7 +1248,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_requests().
*/
public function test_get_data_requests() {
public function test_get_data_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -1355,7 +1355,7 @@ class external_test extends externallib_advanced_testcase {
/**
* Test for external::get_data_requests() invalid user id.
*/
public function test_get_data_requests_invalid_userid() {
public function test_get_data_requests_invalid_userid(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -43,7 +43,7 @@ class submit_selected_courses_form_test extends \externallib_advanced_testcase {
/**
* Test for submit_selected_courses_form().
*/
public function test_submit_selected_courses_form() {
public function test_submit_selected_courses_form(): void {
global $DB;
$this->resetAfterTest();
@@ -33,7 +33,7 @@ class filtered_userlist_test extends \advanced_testcase {
* @param array $unexpired The set of userids considered as unexpired.
* @param array $expected The expected values.
*/
public function test_apply_expired_contexts_filters(array $initial, array $expired, array $unexpired, array $expected) {
public function test_apply_expired_contexts_filters(array $initial, array $expired, array $unexpired, array $expected): void {
$userlist = $this->getMockBuilder(\tool_dataprivacy\filtered_userlist::class)
->disableOriginalConstructor()
->onlyMethods([])
@@ -32,7 +32,7 @@ class manager_observer_test extends data_privacy_testcase {
/**
* Ensure that when users are configured as DPO, they are sent an message upon failure.
*/
public function test_handle_component_failure() {
public function test_handle_component_failure(): void {
$this->resetAfterTest();
// Create another user who is not a DPO.
@@ -65,7 +65,7 @@ class manager_observer_test extends data_privacy_testcase {
/**
* Ensure that when no user is configured as DPO, the message is sent to admin instead.
*/
public function test_handle_component_failure_no_dpo() {
public function test_handle_component_failure_no_dpo(): void {
$this->resetAfterTest();
// Create another user who is not a DPO or admin.
@@ -47,7 +47,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Test that we can fetch metadata about users for the whole system and that it matches the system count.
*/
public function test_get_registry_metadata_count() {
public function test_get_registry_metadata_count(): void {
$data = $this->get_meta_data();
$plugintypes = \core_component::get_plugin_types();
@@ -71,7 +71,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Check that the expected null provider information is returned.
*/
public function test_get_registry_metadata_null_provider_details() {
public function test_get_registry_metadata_null_provider_details(): void {
$data = $this->get_meta_data();
// Check details of core privacy (a null privder) are correct.
@@ -83,7 +83,7 @@ class metadata_registry_test extends \advanced_testcase {
/**
* Check that the expected privacy provider information is returned.
*/
public function test_get_registry_metadata_provider_details() {
public function test_get_registry_metadata_provider_details(): void {
$data = $this->get_meta_data();
// Check details of core rating (a normal provider) are correct.
@@ -46,7 +46,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_contexts_for_userid() {
public function test_get_contexts_for_userid(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -65,7 +65,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_users_in_context() {
public function test_get_users_in_context(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -82,7 +82,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_get_users_in_context_non_user_context() {
public function test_get_users_in_context_non_user_context(): void {
$context = \context_system::instance();
$userlist = new userlist($context, 'tool_dataprivacy');
@@ -96,7 +96,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_export_user_data() {
public function test_export_user_data(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -152,7 +152,7 @@ class provider_test extends provider_testcase {
*
* @return void
*/
public function test_export_user_preferences() {
public function test_export_user_preferences(): void {
$this->resetAfterTest();
$user = $this->getDataGenerator()->create_user();
@@ -45,7 +45,7 @@ class task_test extends \data_privacy_testcase {
* is created when there are not any existing data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_no_previous_requests() {
public function test_delete_existing_deleted_users_task_no_previous_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -74,7 +74,7 @@ class task_test extends \data_privacy_testcase {
* Ensure that a delete data request for pre-existing deleted users
* is not being created when automatic creation of delete data requests is disabled.
*/
public function test_delete_existing_deleted_users_task_automatic_creation_disabled() {
public function test_delete_existing_deleted_users_task_automatic_creation_disabled(): void {
global $DB;
$this->resetAfterTest();
@@ -104,7 +104,7 @@ class task_test extends \data_privacy_testcase {
* is created when there are existing non-delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_export_data_requests() {
public function test_delete_existing_deleted_users_task_existing_export_data_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -139,7 +139,7 @@ class task_test extends \data_privacy_testcase {
* is not created when there are existing ongoing delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_ongoing_delete_data_requests() {
public function test_delete_existing_deleted_users_task_existing_ongoing_delete_data_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -179,7 +179,7 @@ class task_test extends \data_privacy_testcase {
* is not created when there are existing finished delete data requests
* for that particular user.
*/
public function test_delete_existing_deleted_users_task_existing_finished_delete_data_requests() {
public function test_delete_existing_deleted_users_task_existing_finished_delete_data_requests(): void {
global $DB;
$this->resetAfterTest();
@@ -30,7 +30,7 @@ class user_deleted_observer_test extends \advanced_testcase {
/**
* Ensure that a delete data request is created upon user deletion.
*/
public function test_create_delete_data_request() {
public function test_create_delete_data_request(): void {
$this->resetAfterTest();
// Enable automatic creation of delete data requests.
@@ -50,7 +50,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is not created upon user deletion if automatic creation of
* delete data requests is disabled.
*/
public function test_create_delete_data_request_automatic_creation_disabled() {
public function test_create_delete_data_request_automatic_creation_disabled(): void {
$this->resetAfterTest();
// Disable automatic creation of delete data requests.
@@ -70,7 +70,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if an ongoing export data request (or any other except delete data request) for that user already exists.
*/
public function test_create_delete_data_request_export_data_request_preexists() {
public function test_create_delete_data_request_export_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -96,7 +96,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is not being created upon user deletion
* if an ongoing delete data request for that user already exists.
*/
public function test_create_delete_data_request_ongoing_delete_data_request_preexists() {
public function test_create_delete_data_request_ongoing_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -121,7 +121,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if a finished delete data request (excluding complete) for that user already exists.
*/
public function test_create_delete_data_request_canceled_delete_data_request_preexists() {
public function test_create_delete_data_request_canceled_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -151,7 +151,7 @@ class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if a completed delete data request for that user already exists.
*/
public function test_create_delete_data_request_completed_delete_data_request_preexists() {
public function test_create_delete_data_request_completed_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -30,7 +30,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::is_extension_invalid
*/
public function test_is_extension_invalid() {
public function test_is_extension_invalid(): void {
// The pdf file extension already exists in default moodle minetypes.
$this->assertTrue(utils::is_extension_invalid('pdf'));
@@ -52,7 +52,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::is_defaulticon_allowed
*/
public function test_is_defaulticon_allowed() {
public function test_is_defaulticon_allowed(): void {
// You ARE allowed to set a default icon for a MIME type that hasn't
// been used yet.
$this->assertTrue(utils::is_defaulticon_allowed('application/x-frog'));
@@ -71,7 +71,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::get_icons_from_path
*/
public function test_get_icons_from_path() {
public function test_get_icons_from_path(): void {
// Get icons from the fixtures folder.
$icons = utils::get_icons_from_path(__DIR__ . '/fixtures');
@@ -86,7 +86,7 @@ class tool_filetypes_test extends advanced_testcase {
*
* @covers ::get_file_icons
*/
public function test_get_file_icons() {
public function test_get_file_icons(): void {
$icons = utils::get_file_icons();
$filetypes = core_filetypes::get_types();
@@ -374,8 +374,9 @@ class tool_generator_course_backend extends tool_generator_backend {
private function create_user_accounts($first, $last) {
global $CFG;
$this->log('createaccounts', (object)array('from' => $first, 'to' => $last), true);
$count = $last - $first + 1;
$this->log('createusers', $count, true);
$done = 0;
for ($number = $first; $number <= $last; $number++, $done++) {
// Work out username with 6-digit number.
@@ -67,6 +67,12 @@ class runner {
if (!class_exists('Behat\Gherkin\Lexer')) {
throw new \moodle_exception('Missing behat classes.');
}
// Behat constant.
if (!defined('BEHAT_TEST')) {
define('BEHAT_TEST', 1);
}
// Behat utilities.
require_once($CFG->libdir . '/behat/classes/util.php');
require_once($CFG->libdir . '/behat/classes/behat_command.php');
@@ -118,6 +118,9 @@ if (!file_exists($featurefile)) {
exit(0);
}
// Switch to admin user account.
\core\session\manager::set_user(get_admin());
$runner = new tool_generator\local\testscenario\runner();
try {
@@ -78,6 +78,7 @@ $string['progress_createcourse'] = 'Creating course {$a}';
$string['progress_createforum'] = 'Creating forum ({$a} posts)';
$string['progress_createpages'] = 'Creating pages ({$a})';
$string['progress_createsmallfiles'] = 'Creating small files ({$a})';
$string['progress_createusers'] = 'Creating user accounts ({$a})';
$string['progress_enrol'] = 'Enrolling users into course ({$a})';
$string['progress_sitecompleted'] = 'Site completed ({$a}s)';
$string['shortsize_0'] = 'XS';
@@ -30,7 +30,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates a small test course and checks all the components have been put in place.
*/
public function test_make_xs_course() {
public function test_make_xs_course(): void {
global $DB;
$this->resetAfterTest();
@@ -137,7 +137,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates an small test course with fixed data set and checks the used sections and users.
*/
public function test_fixed_data_set() {
public function test_fixed_data_set(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -178,7 +178,7 @@ class maketestcourse_test extends \advanced_testcase {
/**
* Creates a small test course specifying a maximum size and checks the generated files size is limited.
*/
public function test_filesize_limit() {
public function test_filesize_limit(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -40,7 +40,7 @@ class maketestsite_test extends \advanced_testcase {
/**
* Checks that site courses shortnames are properly generated.
*/
public function test_shortnames_generation() {
public function test_shortnames_generation(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -138,7 +138,7 @@ class httpsreplace_test extends \advanced_testcase {
* @param string $expectedcontent What content we are expecting afterwards.
* @dataProvider upgrade_http_links_provider
*/
public function test_upgrade_http_links($content, $ouputregex, $expectedcontent) {
public function test_upgrade_http_links($content, $ouputregex, $expectedcontent): void {
global $DB;
$this->resetAfterTest();
@@ -212,7 +212,7 @@ class httpsreplace_test extends \advanced_testcase {
* @param string $expectedcount Number of urls from that domain that we expect to be replaced.
* @dataProvider http_link_stats_provider
*/
public function test_http_link_stats($content, $domain, $expectedcount) {
public function test_http_link_stats($content, $domain, $expectedcount): void {
$this->resetAfterTest();
$finder = new tool_httpreplace_url_finder_mock();
@@ -230,7 +230,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test links and text are not changed
*/
public function test_links_and_text() {
public function test_links_and_text(): void {
global $DB;
$this->resetAfterTest();
@@ -261,7 +261,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* If we have an http wwwroot then we shouldn't report it.
*/
public function test_httpwwwroot() {
public function test_httpwwwroot(): void {
global $DB, $CFG;
$this->resetAfterTest();
@@ -286,7 +286,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test that links in excluded tables are not replaced
*/
public function test_upgrade_http_links_excluded_tables() {
public function test_upgrade_http_links_excluded_tables(): void {
$this->resetAfterTest();
set_config('test_upgrade_http_links', '<img src="http://somesite/someimage.png" />');
@@ -306,7 +306,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test renamed domains
*/
public function test_renames() {
public function test_renames(): void {
global $DB, $CFG;
$this->resetAfterTest();
$this->expectOutputRegex('/UPDATE/');
@@ -339,7 +339,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* When there are many different pieces of contents from the same site, we should only run replace once
*/
public function test_multiple() {
public function test_multiple(): void {
global $DB;
$this->resetAfterTest();
$original1 = '';
@@ -376,7 +376,7 @@ class httpsreplace_test extends \advanced_testcase {
/**
* Test the tool when the column name is a reserved word in SQL (in this case 'where')
*/
public function test_reserved_words() {
public function test_reserved_words(): void {
global $DB;
$this->resetAfterTest();

Some files were not shown because too many files have changed in this diff Show More