The tool_generator creates a testing scenario that can execute
all steps from behat_data_generators (with some limitations),
change admin settings and delete courses and users to cleanup
the created entities. However, this list of valid steps will
change over time and it will be great if all available steps
are listed with examples.
Some places where using the wrong icon and now that they have changed,
they need to be updated. For instance:
- i/settings (cog) should be used for settings or configure.
- t/edit (pen) should be used for editing
Where the previous output was simple count of days, switch to using
the new format helper to return a time duration.
AMOS BEGIN
CPY [daystakingcourse,core_course],[daystakingcourse,core_completion]
AMOS END
For columns whose values can be represented purely in SQL, we don't
need to/shouldn't select extra data because it confuses the column
output during aggregation for numeric/boolean columns.
The tool_generator creates a testing scenario that can
execute all steps from behat_data_generators (with some
limitations) and admin settings. With the patch the scenario file can
incorporate a cleanup steps to be executed when the manual test is done.
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.
The following changes have been done to improve the reset course:
- Reset course button moved to sticky footer. Select default and
deselect all buttons set as secondary and left at the end of the form
- Adjusted page layout to a standardized format, centering the form for
improving presentation and recolocating the Reset course button away
from the bottom-right corner
- Changed page layout to standard, to display the form centered and
avoid having the Reset course button in the right bottom corner
- Modal added before resetting a course, asking user for confirmation
- Reset course buttons displayed with danger styling, because they
remove information
- All sections are expanded by default
- Default options are selected by default
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.
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).
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 inherent issues with task blocking which mean that it has
never worked properly. It is also very buggy and can lead to massive
performance issues with task processing.
It is almost impossible to deprecate this in a staged fashion because
various APIs use the methods and it is not possible to determine which
are API uses and which are other valid uses.
In reality there has been little-to-no uptake on the use of this feature
and it should just be removed.