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.
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.
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.
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.
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.
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 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).
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.
The changes here are heterogeneous:
- Include stuff that is not available (other test has included it).
Sometimes local to a unit test, others in setupBeforeClass() or
globally, ... depends on every case.
- Rename some tests (namespaces, test name, ...) towards getting it
running.
- Amend small bits here and there.
Important note: I've left any "cosmetic" warning out from the
changes, only a few errors (like long array syntax) have been fixed.
There are a few tests in core that are commented since the
beginning. That's not useful at all, so with this commit we
are un-commenting them instead.
Note that this is an initial step to have them back with skipped
outcome. Later in this issue we'll decide about to keep them or
completely remove them (each test can have a different outcome).