Commit graph

3852 commits

Author SHA1 Message Date
Mihail Geshoski
63e341d4d5 MDL-80744 behat: Create steps for the search combo box component 2024-07-15 16:36:45 +08:00
Andrew Nicols
0270c90dc0
MDL-66903 core: Introduce \core\component::resetto 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 13:07:42 +08:00
Andrew Nicols
25df1ed645
MDL-66903 core: Move core_component to \core\component 2024-07-15 13:07:42 +08:00
Andrew Nicols
406dcd2566
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 13:07:36 +08:00
Andrew Nicols
3c03e9448c
MDL-66903 testing: Fix whitespace 2024-07-15 12:23:05 +08:00
Paul Holden
9b624edba9
MDL-82444 core: skip environment test on optional plugin extensions. 2024-07-12 13:49:10 +01:00
Andrew Nicols
5efe90187d
Merge branch 'MDL-82431' of https://github.com/paulholden/moodle 2024-07-11 11:46:04 +08:00
Huong Nguyen
2845d8cbde
Merge branch 'MDL-79717' of https://github.com/paulholden/moodle 2024-07-11 09:34:52 +07:00
Paul Holden
8413f61260
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:14 +01:00
Paul Holden
9d621f5da1
MDL-82066 user: define methods for handling default homepage URLs.
Per the previous commit, default homepage configuration (set either
for the site or as a user preference) can now be extended by third
party hook callbacks, in which case a URL is stored.
2024-07-10 17:12:31 +01:00
Paul Holden
bd0f8a058f
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:49 +01:00
ferranrecio
0ccafe76f6 MDL-81765 mod_subsection: disable mod subsection by default 2024-07-08 13:34:28 +02:00
ferranrecio
c13d579b5e MDL-81765 course: module delegated section logic
Having mod_subsection into core was a pre-requisite to incorporate some
phpunit and behat tests that are pending from previous issues. Also,
some new sectiondelegatemodule methods are added tu support the new
plugin.
2024-07-05 08:29:21 +02:00
Huong Nguyen
ccd8089de9
Merge branch 'MDL-80907' of https://github.com/marinaglancy/moodle 2024-07-04 11:12:50 +07:00
Amaia Anabitarte
f9497ceade MDL-81771 core_report: Add Report as subsystem 2024-07-03 15:47:46 +02:00
Ilya Tregubov
8dc76d79e5 Merge branch 'main_MDL-82141' of https://github.com/mattporritt/moodle 2024-07-02 13:19:55 +08:00
Ilya Tregubov
0a7fddefd3 MDL-81647 core: Code style fix. 2024-07-02 10:15:18 +08:00
Ilya Tregubov
f0d194089f Merge branch 'MDL-81647-main' of https://github.com/andrewnicols/moodle 2024-07-02 09:26:13 +08:00
Sara Arjona
576e63cb0f
Merge branch 'MDL-63753' of https://github.com/larsbonczek/moodle 2024-07-01 12:18:50 +02:00
Amaia Anabitarte
de2adae485 MDL-79971 completion: Don't assume a completed activity is viewed 2024-06-28 10:14:46 +02:00
Jun Pataleta
1306c52855
Merge branch 'MDL-81960-main' of https://github.com/andrewnicols/moodle 2024-06-27 12:16:18 +08:00
Andrew Nicols
e3f795fc72
MDL-81960 core: Move progress_trace tests out of weblib 2024-06-27 11:35:37 +08:00
Andrew Nicols
097b3fbee3
MDL-81960 core: Move moodle_url tests to correct location 2024-06-27 11:35:31 +08:00
Andrew Nicols
b637f8cc4e
MDL-81960 core: Coding style fixes 2024-06-27 11:34:30 +08:00
Jun Pataleta
e84daab7dd
Merge branch 'MDL-82183-main-squashed' of https://github.com/andrewnicols/moodle 2024-06-27 08:49:13 +08:00
Jun Pataleta
75f2afc3dc
Merge branch 'MDL-81920' of https://github.com/paulholden/moodle 2024-06-26 23:23:01 +08:00
Andrew Nicols
9043dc75bf
MDL-82183 core: Coding style fixes for core\output 2024-06-26 23:00:33 +08:00
Andrew Nicols
ff0fd2764a
MDL-82183 core: Update namespace of moved output classes 2024-06-26 23:00:33 +08:00
Andrew Nicols
2fff48b07c
MDL-82183 core: Migrate all output classes to autoloaded 2024-06-26 23:00:31 +08:00
Andrew Nicols
77f9238cf4
MDL-82287 core: Deprecate long-deprecated functions
These were originally believed to be so widely used that we could never
migrate away from them but it seems we have!
2024-06-26 22:19:07 +08:00
Paul Holden
751aa2efc3
MDL-81920 core: move emoticon manager class into autoload namespace. 2024-06-26 14:23:30 +01:00
Paul Holden
cc30087d84
MDL-81920 lang: move language string class into autoload namespace. 2024-06-26 14:23:11 +01:00
Lars Bonczek
a48d11dd7d MDL-63753 course: Show stealth activity links to non-editing teachers 2024-06-26 12:57:36 +02:00
Eloy Lafuente (stronk7)
ad5fe71868
MDL-82207 phpunit: fix various @covers annotations (take#1)
This fixes various (not all) wrong @covers annotations that
are reported as warnings by PHPUnit when it's run with
code-coverage enabled.

When possible, the preferred solution is to change to
@covers at class level, that is the recommended way.

If multiple classes are involved, then a mix of @coversDefaultClass
and @covers at method level are used (always trying to use the
minimum needed patch).

This is the first of a series of issues created as sub-tasks
of MDL-82142.
2024-06-24 12:07:39 +02:00
Martin Gauk
fe9616edcd MDL-80345 core_lock: deal with hash collisions in postgres_lock_factory 2024-06-21 13:44:33 +02:00
Matt Porritt
c6e0b0f346 MDL-82141 Administration: Use toggle for Plugin Management Table
Replace the "eye" icon for enabling and disabling plugins in tables
that use the Plugin Management Table (plugin_management_table) class
with the Font Awesome "toggle" icon.
2024-06-21 12:18:55 +10:00
Andrew Nicols
e138e03b2f
MDL-81960 core: Move moodle_url to \core\url 2024-06-20 23:21:56 +08:00
Huong Nguyen
ebae7fbae4
Merge branch 'MDL-81523' of https://github.com/stronk7/moodle 2024-06-19 09:52:10 +07:00
Paul Holden
3724f682b3
Merge branch 'MDL-82191-main' of https://github.com/andrewnicols/moodle into main 2024-06-18 12:11:23 +01:00
Eloy Lafuente (stronk7)
adb4a5aade
MDL-82148 phpunit: Remove all cases of multiple @coversDefaultClass
Only one by class is allowed (to be used as shortcut exclusively)
2024-06-15 21:43:31 +02:00
Eloy Lafuente (stronk7)
674497a12c
MDL-81523 phpunit: Add all missing setUp/tearDown parent calls
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.

While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().

Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
2024-06-14 16:04:57 +02:00
Andrew Nicols
8c1ab804b3
MDL-82191 core: Deprecated unused stale libraries 2024-06-14 09:27:42 +08:00
Huong Nguyen
6b0c51a2ca
Merge branch 'MDL-81781' of https://github.com/paulholden/moodle 2024-06-13 10:12:37 +07:00
Sara Arjona
b1b3f409fc
Merge branch 'MDL-81942' of https://github.com/paulholden/moodle 2024-06-12 15:47:54 +02:00
Paul Holden
f4d4f1ca6a
MDL-81942 user: guests should respect default site homepage setting. 2024-06-12 11:34:59 +01:00
Eloy Lafuente (stronk7)
6c35a65e1a
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 11:55:08 +02:00
Eloy Lafuente (stronk7)
4f7631113c
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 11:55:08 +02:00
Eloy Lafuente (stronk7)
01148a0816
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 11:55:07 +02:00
Paul Holden
a0d5133f10
MDL-81781 dataformat: public helper method to get writer instance. 2024-06-07 11:29:10 +01:00
Andrew Nicols
8a92cb82a6
Merge branch 'MDL-81794-main' of https://github.com/meirzamoodle/moodle 2024-06-06 22:02:36 +08:00