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).
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.
Activity chooser is saving section number in a data attribute called
data-sectionid. We should use data-sectionnum instead to make it easier
to understand.
* When a course activity is specified via an anchor in the URL we
should expand the course content containing the activity
* When we point to a specific activity via an anchor in the URL we should
expand the course index (section) surrounding the actitity.
- Created sectiondelegatemodule abstract class for those delegated sections
managed by a module
- This class will override get_parent_section from the base class, retrieving
the parent section from the module
The section header from the section template has been moved to the content template
so we don't close it from within the content template.
Nothing seems to use the content template, so there should not be any
differences in HTML output anywhere.
core_courseformat\external\get_state calls export_for_tempalte for each
course module, which in turn calls completion_info::is_tracked_user()
for the current user on the current course. The result of this call will
be the same for every course module, so does not need to be called what
may be several hundred times.
This change allows the result of is_tracked_user to be passed to the cm
state object, then calls it once and passes it to each cm's object. If
it is not passed in, it will be computed on demand as before.