Andrew Nicols [Tue, 6 Feb 2024 05:05:49 +0000 (13:05 +0800)]
MDL-80838 core: Add PSR-20/Clock support
This commit adds the PSR-20 ClockInterface to core, with a
moodle-specific extension to the Interface at `\core\clock`, and a
standard clock at `\core\system_clock`.
Further clocks are provided as `\incrementing_clock` and `\frozen_clock`
which are available to unit tests using:
- `$this->mock_clock_with_incrementing(?int $starttime = null);`
- `$this->mock_clock_with_frozen(?int $time = null);`
For the incrementing clock, every call to fetch the time will bump the
current time by one second.
For the frozen clock the time will not change, but can be modified with:
- `$clock->set_to(int $time);`; and
- `$clock->bump(int $seconds = 1);`
Sara Arjona [Tue, 26 Mar 2024 11:31:36 +0000 (12:31 +0100)]
on-demand release 4.4dev+
Jun Pataleta [Tue, 26 Mar 2024 04:05:40 +0000 (12:05 +0800)]
Merge branch 'MDL-80875-main' of https://github.com/sarjona/moodle
Jun Pataleta [Tue, 26 Mar 2024 03:19:42 +0000 (11:19 +0800)]
Merge branch 'MDL-81233-main' of https://github.com/andrewnicols/moodle
Jun Pataleta [Tue, 26 Mar 2024 03:16:34 +0000 (11:16 +0800)]
Merge branch 'MDL-80384-main' of https://github.com/junpataleta/moodle
Huong Nguyen [Tue, 26 Mar 2024 03:08:06 +0000 (10:08 +0700)]
Merge branch 'MDL-78551-main' of https://github.com/safatshahin/moodle
Jun Pataleta [Mon, 25 Mar 2024 16:03:14 +0000 (00:03 +0800)]
MDL-80384 courseformat: Set activity icon alt text on editing mode
From a warning using WAVE:
* The title attribute value for images that lack an alt attribute value
will be presented to screen reader users. However, providing image
content in the alt attribute typically provides better accessibility,
and should be used in most cases. The title attribute will generate a
mouse hover tooltip which may or may not be desired - this tooltip will
not be presented to touch screen or keyboard users.
Safat [Thu, 4 Jan 2024 01:53:13 +0000 (12:53 +1100)]
MDL-78551 core: Version bump
Safat [Thu, 4 Jan 2024 01:52:58 +0000 (12:52 +1100)]
MDL-78551 core: Register hook callbacks and dispatchers
Safat [Thu, 4 Jan 2024 01:48:25 +0000 (12:48 +1100)]
MDL-78551 core_communication: Add hook listeners
Safat [Thu, 4 Jan 2024 01:48:58 +0000 (12:48 +1100)]
MDL-78551 core_access: Add support for hooks api
Safat [Thu, 4 Jan 2024 01:48:02 +0000 (12:48 +1100)]
MDL-78551 core_enrol: Add support for hooks api
Safat [Thu, 4 Jan 2024 01:47:26 +0000 (12:47 +1100)]
MDL-78551 core_course: Add hooks api for course updates
Safat [Thu, 4 Jan 2024 01:47:12 +0000 (12:47 +1100)]
MDL-78551 core_user: Add hooks api for user updates
Safat [Thu, 4 Jan 2024 01:46:55 +0000 (12:46 +1100)]
MDL-78551 core_group: Add hooks api for group and membership
Jun Pataleta [Tue, 26 Mar 2024 02:34:47 +0000 (10:34 +0800)]
Merge branch 'MDL-81266' of https://github.com/stronk7/moodle
Sara Arjona [Mon, 25 Mar 2024 16:15:29 +0000 (17:15 +0100)]
Merge branch 'MDL-81277-main' of https://github.com/laurentdavid/moodle
Sara Arjona [Mon, 25 Mar 2024 16:01:40 +0000 (17:01 +0100)]
Merge branch 'MDL-81246-main' of https://github.com/HuongNV13/moodle
Jun Pataleta [Mon, 25 Mar 2024 15:37:57 +0000 (23:37 +0800)]
Merge branch 'MDL-78885-main' of https://github.com/rezaies/moodle
Eloy Lafuente (stronk7) [Mon, 25 Mar 2024 10:45:09 +0000 (11:45 +0100)]
MDL-81266 phpunit: Document the changes in lib/upgrade.txt
Eloy Lafuente (stronk7) [Thu, 21 Mar 2024 09:12:33 +0000 (10:12 +0100)]
MDL-81266 phpunit: Remove expect(Deprecation|Notice|Warning|Error)
PHPUnit 9.6 has deprecated all the expect(Deprecation|Notice|Warning|Error)
assertions, so we have to move away from them.
In core, we only had 2 cases, one easily fixed by getting rid of it,
because, for php >= 80 it's an assert-able exception.
And the other replaced with code that, temporarily, sets a custom
error handler that converts any specified E_ to an asset-able
exception.
Note that tests playing with error handlers should, always, be
run in separate process, to avoid problems or conflicts with
PHPUnit / Moodle own error handlers.
Daniel Ziegenberg [Tue, 19 Mar 2024 10:11:59 +0000 (11:11 +0100)]
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266
When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."
So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.
PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit. PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Daniel Ziegenberg [Tue, 19 Mar 2024 10:11:59 +0000 (11:11 +0100)]
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266
When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."
So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.
PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit. PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Sara Arjona [Mon, 25 Mar 2024 15:20:25 +0000 (16:20 +0100)]
Merge branch 'MDL-80088' of https://github.com/paulholden/moodle
Eloy Lafuente (stronk7) [Mon, 18 Mar 2024 12:53:45 +0000 (13:53 +0100)]
MDL-81266 composer: PHPUnit 9.6, Behat to 3.14 and other deps
Bump to PHPUnit 9.6 towards warning in advance about
stuff that will be removed for PHPUnit 10, namely:
- expect[Deprecation|Error|Notice|Warning] methods.
- assert[Object|Class][Not]Has[Static]Attribute methods.
- withConsecutive()
- TestCase::getMockClass()
- "Test" suffix for abstract test case classes.
The behat bump is only applied to 402_STABLE and up, all them
requiring PHP 8.0 as a minimum. And generated following the
instructions in the dev docs.
Laurent David [Mon, 8 Jan 2024 11:24:00 +0000 (12:24 +0100)]
MDL-80384 core_courseformat: Remove activty icon link
* Remove the link over the image icon for an activity and use
the title attribute for the tooltip
Laurent David [Tue, 19 Mar 2024 06:38:55 +0000 (07:38 +0100)]
MDL-81277 lib: Update atto codemirror to 5.65.16
Sara Arjona [Mon, 25 Mar 2024 12:01:03 +0000 (13:01 +0100)]
Merge branch 'MDL-79368-main' of https://github.com/roland04/moodle
Sara Arjona [Fri, 22 Mar 2024 12:45:10 +0000 (13:45 +0100)]
MDL-80875 uploadcourse: Fix params validation
Andrew Nicols [Mon, 25 Mar 2024 06:23:21 +0000 (14:23 +0800)]
MDL-80300 mod_quiz: Integration coding fixups
Andrew Nicols [Mon, 25 Mar 2024 07:06:50 +0000 (15:06 +0800)]
Merge branch 'mdl-80300-main-refactor' of https://github.com/matthewhilton/moodle
Ilya Tregubov [Mon, 25 Mar 2024 06:23:53 +0000 (14:23 +0800)]
Merge branch 'MDL-63128-main' of https://github.com/meirzamoodle/moodle
meirzamoodle [Wed, 21 Feb 2024 09:25:38 +0000 (16:25 +0700)]
MDL-63128 core_cache: Add new is_cluster_available helper
The ::is_cluster_available() will return true if the PHP support redis cluster.
meirzamoodle [Wed, 27 Dec 2023 02:31:51 +0000 (09:31 +0700)]
MDL-63128 core: Add support for use redis cluster as session handler
Co-authored-by: Avi Levy <avi@sysbind.co.il>
meirzamoodle [Wed, 27 Dec 2023 02:28:47 +0000 (09:28 +0700)]
MDL-63128 cachestore_redis: Support Redis cluster as cache store
Co-authored-by: Daniel Thee Roperto <daniel@theeroperto.com>
Co-authored-by: Avi Levy <avi@sysbind.co.il>
Jake Dallimore [Mon, 25 Mar 2024 04:25:51 +0000 (12:25 +0800)]
Merge branch 'MDL-79239-master' of https://github.com/ssj365/moodle
Andrew Nicols [Mon, 25 Mar 2024 03:43:28 +0000 (11:43 +0800)]
Merge branch 'MDL-80827-main' of https://github.com/stevandoMoodle/moodle
Huong Nguyen [Mon, 25 Mar 2024 02:22:20 +0000 (09:22 +0700)]
Merge branch 'MDL-79829-main' of https://github.com/laurentdavid/moodle
Huong Nguyen [Mon, 25 Mar 2024 02:15:12 +0000 (09:15 +0700)]
Merge branch 'MDL-81074-main' of https://github.com/andrewnicols/moodle
Andrew Nicols [Mon, 18 Mar 2024 15:41:10 +0000 (23:41 +0800)]
MDL-81074 core: Simplify strftime tests
Luca Bösch [Wed, 28 Feb 2024 09:44:27 +0000 (10:44 +0100)]
MDL-81074 core: align core_date::strftime results for numeric and string
Andrew Nicols [Wed, 20 Mar 2024 06:15:26 +0000 (14:15 +0800)]
MDL-81074 core: Add assertTimeStringMatches PHPUnit Assertion
Also raised as https://github.com/sebastianbergmann/phpunit/issues/5757
Sara Arjona [Fri, 22 Mar 2024 13:03:42 +0000 (14:03 +0100)]
on-demand release 4.4dev+
Sara Arjona [Fri, 22 Mar 2024 13:03:42 +0000 (14:03 +0100)]
NOBUG: Fixed file access permissions
Sara Arjona [Fri, 22 Mar 2024 13:03:38 +0000 (14:03 +0100)]
NOBUG: Fixed SVG browser compatibility
Jun Pataleta [Fri, 22 Mar 2024 03:57:23 +0000 (11:57 +0800)]
Merge branch 'MDL-81132-master' of https://github.com/jleyva/moodle
Jun Pataleta [Fri, 22 Mar 2024 03:47:56 +0000 (11:47 +0800)]
Merge branch 'MDL-81313-main' of https://github.com/snake/moodle
Jun Pataleta [Fri, 22 Mar 2024 03:34:23 +0000 (11:34 +0800)]
Merge branch 'MDL-80843' of https://github.com/paulholden/moodle
Ilya Tregubov [Fri, 22 Mar 2024 03:07:55 +0000 (11:07 +0800)]
Merge branch 'MDL-80099_main' of https://github.com/marxjohnson/moodle
Ilya Tregubov [Fri, 22 Mar 2024 01:29:38 +0000 (09:29 +0800)]
Merge branch 'MDL-81319' of https://github.com/stronk7/moodle
Ilya Tregubov [Fri, 22 Mar 2024 01:22:19 +0000 (09:22 +0800)]
Merge branch 'MDL-81023-main' of https://github.com/aanabit/moodle
Ilya Tregubov [Fri, 22 Mar 2024 01:17:55 +0000 (09:17 +0800)]
Merge branch 'MDL-80715-main' of https://github.com/ferranrecio/moodle
Mathew May [Thu, 9 Nov 2023 07:33:39 +0000 (15:33 +0800)]
MDL-78885 comboboxsearch: Points from review
Shamim Rezaie [Tue, 14 Nov 2023 20:55:54 +0000 (07:55 +1100)]
MDL-78885 comboboxsearch: Deprecate trigger
Shamim Rezaie [Tue, 14 Nov 2023 20:40:49 +0000 (07:40 +1100)]
MDL-78885 gradereport_grader: minor fixes to the collapse columns
Shamim Rezaie [Tue, 31 Oct 2023 21:12:59 +0000 (08:12 +1100)]
MDL-78885 comboboxsearch: Some small fixes
- Remove aria-busy
- Remove aria-label from the listbox element. A listbox that is part of
a combobox does not need to be labelled.
- No need for the aria-label for the select all checkbox because it is
already enclosed in the <label> tag.
- Having "view results for ..." as aria-label of listbox options is not
helpful and only creates noise.
- Deprecated (viewresults,core) as it was not used anymore
- aria-hidden="true" should not be used on .d-none elements
- 'noresults' was falsely documented as a required context variable for
resultset.mustache. Not only it was not required, it was not even
provided!
- Remove duplicate code from user_selector.mustache
- Remove the redundant aria-label from search_input_auto. It already has
a label.
- Fix placeholder missing from one case
Shamim Rezaie [Sat, 4 Nov 2023 16:28:03 +0000 (03:28 +1100)]
MDL-78885 comboboxsearch: Show x button when user search is not empty
Shamim Rezaie [Sat, 4 Nov 2023 15:10:29 +0000 (02:10 +1100)]
MDL-78885 comboboxsearch: Comboboxes should have a meaningful label
Also, used the combobox's label as the dialogue's label as well
Shamim Rezaie [Mon, 30 Oct 2023 14:15:15 +0000 (01:15 +1100)]
MDL-78885 comboboxsearch: Remove the redundant rtl context variable
Shamim Rezaie [Tue, 31 Oct 2023 11:20:31 +0000 (22:20 +1100)]
MDL-78885 aria: Add support for data-short-text
Shamim Rezaie [Mon, 30 Oct 2023 06:12:48 +0000 (17:12 +1100)]
MDL-78885 aria: Improve focus back
To support the case when a combobox is inside another dropdown
Shamim Rezaie [Tue, 31 Oct 2023 15:04:26 +0000 (02:04 +1100)]
MDL-78885 comboboxsearch: Improve user search and keyboard handling
- Prevent rerendering of the menu when it's already open to preserve the
selected/highlighted option.
- Allow ArrowUp and ArrowDown to trigger the user search dropdown for
improved keyboard navigation.
This commit ensures that the menu is not re-rendered when it's already
open, preserving the selected option to enhance the user experience.
Additionally, ArrowUp and ArrowDown keys now trigger the dropdown,
improving keyboard navigation and user interactions.
Shamim Rezaie [Sun, 29 Oct 2023 20:39:12 +0000 (07:39 +1100)]
MDL-78885 comboboxsearch: Reset status of filters to a zero state
Most of this is automatically handled by aria.js for other comboboxes.
But the search combobox inside the grade and group dropdowns are special
cases because they are not the same as the toggle element of the
dropdown.
Shamim Rezaie [Tue, 24 Oct 2023 16:19:29 +0000 (03:19 +1100)]
MDL-78885 comboboxsearch: Switch event listener from 'click' to 'change'
Move from listening to 'click' to listening to 'change'
Shamim Rezaie [Fri, 13 Oct 2023 03:57:01 +0000 (14:57 +1100)]
MDL-78885 comboboxsearch: .dropdown() calls should be on toggle element
Introduced the toggle property.
Shamim Rezaie [Sun, 29 Oct 2023 20:34:08 +0000 (07:34 +1100)]
MDL-78885 comboboxesearch: user search should have value as well
Shamim Rezaie [Tue, 24 Oct 2023 16:17:38 +0000 (03:17 +1100)]
MDL-78885 comboboxesearch: Comboboxes should have a name and value
- core_grades_renderer::group_selector() was changed previously, but it
was providing redundant context data to
core_group/comboboxsearch/group_selector and on the other hand, it was
not providing 'name' and 'value' for core/comboboxsearch
- The $groupactionbaseurl parameter of
core_grades_renderer::group_selector() is now deprecated as it was not
used.
- a bug is fixed: if only a lastname initial was set, the clear search
button was not being displayed.
Shamim Rezaie [Thu, 5 Oct 2023 14:19:24 +0000 (01:19 +1100)]
MDL-78885 comboboxsearch: remove aria-activedecendant on options change
Shamim Rezaie [Mon, 2 Oct 2023 17:20:40 +0000 (04:20 +1100)]
MDL-78885 comboboxsearch: Enable aria.js for auto handling
- Added the `dropdown` class to ensure toggle element focus when the
dropdown is closed.
- Improved keyboard handling by adding the `dropdown` class.
aria.js will automatically handle keyboard interactions.
- Removed redundant keyboard handling.
- The "view all results" option is just a normal option in a combobox.
It should not be treated as the default action for a combobox.
- Ensured correct markup for 'Esc' key handling. aria.js automatically
focuses on the toggle element if the dropdown's toggle and the
dropdown menu are wrapped within a .dropdown element.
- Implemented menu closure for outside clicks and when leaving the edit
box.
- Manually focused on the user search element when opening the search
dropdown due to a focusLock issue.
- Fix the issue of another dropdown staying open
- Clicking on the clearSearchButton should not close the dropdown
Shamim Rezaie [Mon, 2 Oct 2023 12:54:20 +0000 (23:54 +1100)]
MDL-78885 theme_boost: Revert
3a8eeedf of MDL-75274.
These changes that I'm undoing were not only wrong, but also not used
and were left over code.
Shamim Rezaie [Wed, 11 Oct 2023 22:09:43 +0000 (09:09 +1100)]
MDL-78885 aria: Fix pressing Home and End on editable comboboxes
Shamim Rezaie [Fri, 29 Sep 2023 06:36:49 +0000 (16:36 +1000)]
MDL-78885 aria: Automatically trap focus inside dialog dropdowns
- there is no need to set the focus after a dropdown is opened. It is
automatically set as the result of trapping focus.
Shamim Rezaie [Tue, 31 Oct 2023 06:26:01 +0000 (17:26 +1100)]
MDL-78885 core: combobox should have a valid aria-controls
- The aria-controls attribute cannot refer to an element that doesn't
exist
- Also update filterDataset so it returns [] when searchTerm is empty
Sara Arjona [Thu, 21 Mar 2024 16:30:40 +0000 (17:30 +0100)]
Merge branch 'MDL-80488' of https://github.com/paulholden/moodle
Mathew May [Mon, 11 Sep 2023 07:09:53 +0000 (09:09 +0200)]
MDL-78885 gradereport_singleview: Behat updates after a11y fixes
Mathew May [Thu, 10 Aug 2023 11:49:54 +0000 (19:49 +0800)]
MDL-78885 core_user: A11y fixes for user combobox search
Co-authored-by: Shamim Rezaie <shamim@moodle.com>
Sara Arjona [Thu, 21 Mar 2024 16:18:11 +0000 (17:18 +0100)]
Merge branch 'MDL-79913' of https://github.com/paulholden/moodle
Sara Arjona [Thu, 21 Mar 2024 16:11:29 +0000 (17:11 +0100)]
Merge branch 'MDL-81112' of https://github.com/paulholden/moodle
Sara Arjona [Thu, 21 Mar 2024 16:00:32 +0000 (17:00 +0100)]
Merge branch 'MDL-72376' of https://github.com/paulholden/moodle
Mathew May [Thu, 10 Aug 2023 05:00:26 +0000 (13:00 +0800)]
MDL-78885 gradereport_grader: Collapsing a11y fixes
Sara Arjona [Thu, 21 Mar 2024 15:11:40 +0000 (16:11 +0100)]
Merge branch 'MDL-71734' of https://github.com/paulholden/moodle
Paul Holden [Thu, 21 Mar 2024 14:41:41 +0000 (14:41 +0000)]
Merge branch 'MDL-81163-main' of https://github.com/sarjona/moodle into main
Sara Arjona [Thu, 21 Mar 2024 14:40:24 +0000 (15:40 +0100)]
Merge branch 'MDL-80636-main' of https://github.com/laurentdavid/moodle
Sara Arjona [Thu, 21 Mar 2024 14:29:47 +0000 (15:29 +0100)]
Merge branch 'MDL-69688' of https://github.com/stronk7/moodle
Sara Arjona [Thu, 21 Mar 2024 14:01:18 +0000 (15:01 +0100)]
Merge branch 'MDL-80245' of https://github.com/paulholden/moodle
Paul Holden [Thu, 23 Nov 2023 14:41:15 +0000 (14:41 +0000)]
MDL-80245 reportbuilder: implement interface elements for report tags.
Allow them to be edited during report creation/updating, display in
report listings table with filtering, and implement tag callback to
allow them to be discoverable across the site.
Sara Arjona [Thu, 21 Mar 2024 12:21:42 +0000 (13:21 +0100)]
Merge branch 'MDL-81294-main' of https://github.com/roland04/moodle
Amaia Anabitarte [Fri, 23 Feb 2024 11:32:34 +0000 (12:32 +0100)]
MDL-81023 core_course: Move deprecated behat steps to course directory
Eloy Lafuente (stronk7) [Thu, 21 Mar 2024 09:46:01 +0000 (10:46 +0100)]
MDL-81319 install: update the list of stale files for 4.4
Paul Holden [Mon, 9 Oct 2023 09:15:23 +0000 (10:15 +0100)]
MDL-71734 lang: final removal of deprecated 400 strings.
Huong Nguyen [Thu, 21 Mar 2024 08:27:39 +0000 (15:27 +0700)]
Merge branch 'MDL-81276-main' of https://github.com/aanabit/moodle
Huong Nguyen [Thu, 21 Mar 2024 08:12:01 +0000 (15:12 +0700)]
Merge branch 'MDL-81289-main' of https://github.com/ferranrecio/moodle
Huong Nguyen [Thu, 21 Mar 2024 07:53:07 +0000 (14:53 +0700)]
Merge branch 'MDL-80835-main' of https://github.com/snake/moodle
Jake Dallimore [Thu, 15 Feb 2024 04:17:47 +0000 (12:17 +0800)]
MDL-80835 auth_lti: fix bad cast breaking samesite LTI usage
Jake Dallimore [Thu, 15 Feb 2024 04:17:29 +0000 (12:17 +0800)]
MDL-80835 enrol_lti: add partitioning support for OIDC state cookie
Adds the property that is required by Chrome to opt-in to its 3rd party
cookie partitioning solution, CHIPS. This specific change ensures the
'state' cookie, used in the OIDC handshake, has partitioning support.
This cookie can be partitioned unconditionally, since it's a cookie
controlled by the library and one we don't expect to be set without
partitioning elsewhere.
Jake Dallimore [Tue, 30 Jan 2024 04:25:05 +0000 (12:25 +0800)]
MDL-80835 auth_lti: add partitioning to post-auth MoodleSession cookie
Adds the property that is required by Chrome to opt-in to its 3rd party
cookie partitioning solution, CHIPS. This specific change to auth_lti is
to ensure the MoodleSession Set-Cookie header resulting from
complete_user_login() calls (in auth.php) have this property set.
Jake Dallimore [Wed, 14 Feb 2024 03:50:13 +0000 (11:50 +0800)]
MDL-80835 enrol_lti: add cookies required notice to auth login endpoint
This will be displayed if the cookie checks fail, which currently occurs
in Safari only.
Jake Dallimore [Tue, 30 Jan 2024 04:14:45 +0000 (12:14 +0800)]
MDL-80835 enrol_lti: add partitioning support to MoodleSession cookie
Adds the property that is required by Chrome to opt-in to its 3rd party
cookie partitioning solution, CHIPS. This specific change deals with the
cookie that is set when the user is not yet auth'd with the site and is
necessary to facilitate OIDC nonce retrieval and validation.
Jake Dallimore [Tue, 30 Jan 2024 04:14:17 +0000 (12:14 +0800)]
MDL-80835 auth_lti: add cookie helper facilitating CHIPS opt-in
To opt a cookie in to Chrome's 3rd party cookie partitioning solution,
CHIPS, the property 'Partitioned;' needs to be set. This adds a helper
class supporting this, for a given cookie(s).
Note also, PHP's native
cookie APIs (setcookie, etc) don't support this cookie property yet -
(https://github.com/php/php-src/issues/12646).
Since this class is intended to allow existing Set-Cookie headers to be
modified before being sent (e.g. allowing clients to set a property on a
cookie set elsewhere in code), it deals with the headers directly anyway
but it means that new cookies must also use this helper to opt-in,
instead of relying on setcookie(). E.g. where the intent is to add
partitioning support to a new cookie, that cookie must first be set
(setcookie) and then it may opt-in to partitioning via this helper;
partitioning support cannot be achieved directly through setcookie and
friends yet.
Eloy Lafuente (stronk7) [Wed, 20 Mar 2024 22:03:14 +0000 (23:03 +0100)]
MDL-69688 phpunit: Improve test_context_not_used
This adds a few changes to the old test_context_not_used test:
- Move it to become an advanced_test, because its mission
is to verify that the assertEventContextNotUsed() assertion
works as expected.
- For consistency, also move the fixtures to own phpunit fixtures.
- Add proper coverage tags, to verify that the assertion is being
covered.
- Add a data provider to provide all the current cases and ease
any future case that may be needed in the future. One by one
because previously there was code never executed with the
warning expectation causing the test to stop.
- Run them in isolation, while this is not strictly required, it's
including external fixtures and, we'll need that isolation soon
(for changes coming when moving the test to PHPUnit 9.6 in MDL-81266).