3738 Commits

Author SHA1 Message Date
Huong Nguyen
f200548361
MDL-69684 session_redis: Improve PHPUnit test 2024-08-26 10:57:29 +07: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
Andrew Nicols
fb7ef63350
MDL-82110 core: Remove debugging for unmigrated hooks in unit tests 2024-08-20 20:28:49 +08:00
Andrew Nicols
c0a2c4bfd8
MDL-82782 behat: Support runtime scaling of Behat windows 2024-08-14 21:48:44 +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
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
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
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
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
Johannes Burk
0ae247b51f MDL-81689 tasks: add unit test to check for the bug 2024-07-26 10:36:29 +02: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
688ee9e9d1
Merge branch 'MDL-82553-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-07-25 09:17:26 +07: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
Michael Aherne
da95f8d083 MDL-82554 question: Allow null createdby in question_has_capability_on. 2024-07-23 10:47:07 +01:00
Jun Pataleta
cbafc55078
MDL-82553 behat: Run accessibility tests using WCAG 2.2 success criteria 2024-07-22 14:37:49 +08: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
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
03f840b4f2
MDL-82445 core: Create locale helper utility 2024-07-18 11:00:42 +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
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
389e4fc011
MDL-82373 behat: Wait for alerts before accepting/dismissing them 2024-07-17 13:28:56 +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
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
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
Paul Holden
384300011c
MDL-82444 core: skip environment test on optional plugin extensions. 2024-07-12 13:49:54 +01: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
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
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
a0a2015027
Merge branch 'MDL-80907-404' of https://github.com/marinaglancy/moodle into MOODLE_404_STABLE 2024-07-04 11:13:38 +07:00
Amaia Anabitarte
2c804c3ab2 MDL-79971 completion: Don't assume a completed activity is viewed 2024-06-28 10:16:28 +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
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
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
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
Paul Holden
f2dbbfe66e
MDL-81781 dataformat: public helper method to get writer instance. 2024-06-07 11:30:18 +01:00
Andrew Nicols
f6be7e2a3e
Merge branch 'MDL-81794-404' of https://github.com/meirzamoodle/moodle into MOODLE_404_STABLE 2024-06-06 22:06:29 +08:00
Andrew Nicols
253c16b64d
MDL-81894 core: system_clock should use the server timezone 2024-06-06 00:18:52 +08:00
Andrew Nicols
da15787ed0
Merge branch 'MDL-80831-404' of https://github.com/junpataleta/moodle into MOODLE_404_STABLE 2024-05-29 14:27:20 +08:00
Jun Pataleta
63f7c6cc6a
MDL-80831 behat: Re-enable target-size rule for accessibility tests 2024-05-29 10:40:11 +08:00
Andrew Nicols
11e53bf4b0
Merge branch 'MDL-81698_404' of https://github.com/stronk7/moodle into MOODLE_404_STABLE 2024-05-28 10:12:50 +08:00
Eloy Lafuente (stronk7)
b2a485e244
MDL-81698 phpunit: Apply various fixes towards 1by1 execution
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.
2024-05-25 17:19:52 +02:00
Eloy Lafuente (stronk7)
80f521eed0
MDL-81698 phpunit: Uncomment some tests and make them skipped
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).
2024-05-25 17:19:51 +02:00
Anupama Sarjoshi
25724ebfbb MDL-81915 admin: Fix test_admin_output_new_settings_by_page unit test 2024-05-24 11:24:32 +01:00
meirzamoodle
55163a6ba9 MDL-81794 core: Fix the TLS issue on the Redis 2024-05-24 14:28:10 +07:00