Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.11.2
Description
Hi,
As I am currently developing a new question type, I just stumble upon a small issue that if corrected will be helpful for developers.
The issue is in base_testcase.php (https://github.com/moodle/moodle/blob/master/lib/phpunit/classes/base_testcase.php#L58)
If $tags is false, i.e. we don't find the node, then count($tags) results in an error. Preventing the following assertion to display the origin of the issue.
If we write instead something like:
$matched = ($tags && count($tags)) && $tags[0] instanceof DOMNode;
It then does not raise an exception and we can see the full assertion message. Seem that it is still the case on Moodle 4.0.
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-55263 Remove use of deprecated assertTag and assertNotTag
-
- Closed
-