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.
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.
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.
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>
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>
- 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
- 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.
- 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