Closed gjb2048 closed 5 months ago
I suspect this is a case of Windows pathnames not being normalised. Our comparisons for valid paths use a regex of '#.*/tests/.*_test.php#'
.
Writing a test now to confirm this.
Thanks Gareth,
This appears to be a Windows path normalisation issue. I've:
@group
Eloy is on leave for the next few days so I'm afraid it's unlikely that this will get looked at before then. If you're running locally you can clone this repo, merge the branch in #146 locally and run it from there by pointing a repository to it. This is my ~/.composer/composer.json
for reference:
{
"require": {
"moodlehq/moodle-cs": "dev-main"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"repositories": [
{
"type": "path",
"url": "/Users/nicols/git/moodlehq/moodle-cs"
}
],
"minimum-stability": "dev"
}
@andrewnicols Thank you :), I'll have a go as soon as I can (today I hope) as indeed running locally.
@andrewnicols Working, thank you :). I couldn't work out the composer.json replacement, so instead downloaded the code (zip) from https://github.com/andrewnicols/moodle-cs/tree/phpunitTags and replaced manually.
Good stuff @gjb2048, I'll try and remember to ping you when we release so you an roll that back.
@gjb2048, you should be able to update from composer to fix this issue.
@andrewnicols Thank you :)
Using version 3.4.5 - https://github.com/moodlehq/moodle-cs/releases/tag/v3.4.5 - manually downloaded and installed in appropriate vendor folder, I get:
with the code:
and yet https://moodledev.io/general/development/tools/phpunit#using-the-group-annotation states that the tag is valid and how it can be used on the test class - not the test method as stated on https://docs.phpunit.de/en/9.6/annotations.html#group (using PHPUnit 9.6.18 in M4.4 dev - 4.4dev+ (Build: 20240326)).