31136 Commits

Author SHA1 Message Date
Simey Lameze
a24d8a0d2a MDL-63399 behat: new steps to verify downloads
Co-authored-by: Tim Hunt <T.J.Hunt@open.ac.uk>
2024-09-06 12:18:26 +08:00
Marina Glancy
9639feb9a3 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-24 06:30:25 +00:00
Andrew Nicols
ce89c63b0b
MDL-82787 behat: Correct stop of webdriver on failure 2024-08-21 08:46:34 +08:00
Andrew Nicols
a982ebad0c
MDL-82782 behat: Support runtime scaling of Behat windows 2024-08-14 21:51:36 +08:00
Paul Holden
19ad8459d7
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:23:20 +07:00
raortegar
26d7f16686
MDL-81718 core: Improve localstorage validation 2024-08-06 10:36:01 +07:00
Paul Holden
29ab56c4d2 MDL-82392 blocks: consistent cleaning of block instance names. 2024-08-02 01:40:24 +00:00
meirzamoodle
835505681c 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-02 01:40:24 +00:00
Sara Arjona
80b3cb4951
Merge branch 'MDL-82596-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2024-07-31 16:46:29 +02:00
Ilya Tregubov
2883fd28e4 Merge branch 'MDL-80345-401' of https://github.com/MartinGauk/moodle into MOODLE_401_STABLE 2024-07-29 11:35:36 +08:00
Paul Holden
aa7f8f9e09
MDL-82596 behat: switch manual private files upload to generator. 2024-07-28 19:29:54 +01:00
Huong Nguyen
68e93dbfee
Merge branch 'MDL-82527-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2024-07-25 10:50:00 +07:00
Jun Pataleta
c12d07d9d4
Merge branch 'MDL-82373-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2024-07-25 11:30:52 +08:00
Jun Pataleta
a29ef48500
Merge branch 'MDL-77706-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2024-07-25 11:02:16 +08:00
Huong Nguyen
0fae681a7c
Merge branch 'MDL-82553-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2024-07-25 09:18:16 +07:00
Jun Pataleta
b6715bb1ae
MDL-82553 behat: Run accessibility tests using WCAG 2.2 success criteria 2024-07-22 14:38:19 +08:00
Jun Pataleta
40094ddbe0
MDL-82551 core: Set welcome message heading to level 1 2024-07-22 14:21:22 +08:00
Paul Holden
6f3337dcba
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:45:53 +01:00
Andrew Nicols
433109e2ac
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 14:45:23 +08:00
Andrew Nicols
b2320ccd71
MDL-82373 behat: Wait for alerts before accepting/dismissing them 2024-07-17 14:45:22 +08:00
Andrew Nicols
5e4ba1f036
MDL-82373 core: Make CollapsibleRegion more tolerant to behat 2024-07-17 14:45:22 +08:00
Andrew Nicols
535e970ad3
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 14:45:21 +08:00
Andrew Nicols
dd8595035f
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 14:45:21 +08:00
Andrew Nicols
70bbb44030
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:38:21 +08:00
Andrew Nicols
70ab78478f
MDL-66903 core: Check PHPUNIT_TEST defined before using 2024-07-15 13:42:10 +07:00
Huong Nguyen
8a66b2b99a
Merge branch 'MDL-66903-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2024-07-15 13:22:51 +07:00
Andrew Nicols
ee5ac3f1f3
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:20 +08:00
Andrew Nicols
9e71503ab3
MDL-66903 core: Add option to get core in list of components
Note: This change is backported from MDL-81063.
2024-07-15 12:22:19 +08:00
Andrew Nicols
651ecb52d9
MDL-66903 core: Add helper to get component name from classname
Note: This change is backported from MDL-81063.
2024-07-15 12:22:19 +08:00
Andrew Nicols
85845b13d7
MDL-66903 testing: Helper to load fixture files 2024-07-15 12:22:17 +08:00
Andrew Nicols
7b0946129c
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
97060da478
Merge branch 'MDL-82431-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2024-07-11 11:47:18 +08:00
Huong Nguyen
9715fd56da
Merge branch 'MDL-79717-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2024-07-11 09:36:07 +07:00
Paul Holden
a9cc2ebb6e
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:11 +01:00
Paul Holden
1a7ec4cf3d
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:09:00 +01:00
Andrew Nicols
e6966b7ae7
MDL-66903 testing: Fix whitespace 2024-07-05 22:06:09 +08:00
Andrew Nicols
3e81ebecb6
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-05 22:06:09 +08:00
Huong Nguyen
e817dd70db
Merge branch 'MDL-80907-401' of https://github.com/marinaglancy/moodle into MOODLE_401_STABLE 2024-07-04 11:14:56 +07:00
Huong Nguyen
a68fcabc65
MDL-79809 environment: Add missing Moodle 4.4 requirements 2024-06-24 09:37:38 +07:00
Huong Nguyen
2978ffc4a5
MDL-79809 environment: Add recommended custom check
Add support for custom environment checks to have a recommended
option in addition to required an optional.
2024-06-24 09:37:38 +07:00
Martin Gauk
7d77854fd6 MDL-80345 core_lock: deal with hash collisions in postgres_lock_factory 2024-06-20 17:44:24 +02:00
Cameron Ball
836b2c23a2 MDL-81774 curl: Strip auth headers when redirecting to different host 2024-06-05 02:00:21 +00:00
Huong Nguyen
0068701bc6
Merge branch 'MDL-81751-MOODLE_401_STABLE' of https://github.com/durzo/moodle into MOODLE_401_STABLE 2024-06-05 08:57:27 +07:00
Ilya Tregubov
058b11e57b Merge branch 'MDL-77685-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2024-05-31 09:06:09 +08:00
Mihail Geshoski
a7d476c35f
MDL-77685 core_grades: Fix row_column_of_table_should_contain()
Backport from MDL-77632.
2024-05-30 09:42:26 +01:00
Jordan Tomkinson
a48f00d940 MDL-81751 ddl: new reserved keywords in Aurora MySQL database engine 2024-05-16 13:41:25 +01:00
info@eWallah.net
c2193308a6 MDL-80972 behat: Behat check_server_status can provide better info. 2024-05-09 11:08:04 +08:00
Marina Glancy
508d462fa7 MDL-80907 behat: be more precise in selecting table rows 2024-05-07 19:33:35 +01:00
Sara Arjona
3f392e934e
Merge branch 'MDL-81209-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2024-04-23 15:32:42 +02:00
Pol Torrent i Soler
9254b7e75a
MDL-81622 core: fix str_contains usage in cookie_helper 2024-04-23 12:52:58 +02:00