Currently, it is possible to execute tests by "testsuite", "group" and "file/dir":
./console tests:run --testsuite unit --file tests/PHPUnit/file.php groupName
The argument is currently interpreted as a group. I'd suggest to make this argument a bit smarter.
./console tests:run unit
./console tests:run Insights. It would be nice if lower case was possible as well.
.phpsearch for a while having this name in tests folder eg
./console tests:run Widgets.php. To be defined if multiple files have this name. Can we specify multiple files in PHPUnit maybe? --> NO. Maybe instead let the user choose which one should be executed (eg enter number:
 foo/bar.php,  bar/bar.php)
file_existsinterpret it as file / directory
--group? I'd prefer the first one as it could be possible that there is eg a group having the given name but you thought you were executing plugin tests or whatever. Eg if there is a typo etc.
./console tests:run unit Insightsrun all unit tests of the insights plugin? Could be nice
If someone specifies a
--testsuite option and a argument named
unit we should maybe interpret the argument as group? Same for
This will allow us to remove some current groups. Executing groups is not so useful currently as they are not always set and very inconsistent. Eg not all tests in plugins have the group name set. This way we kinda gain "dynamical groups" that actually work.
As this adds some kind of magic and someone might still want to execute a group "unit" or "Insights" we should add another option
--group so people can still avoid the magic and it will be more consistent with
--file and with PHPUnit command line parameters.
Related, but I didn't want to derail the topic: #6634
Except that, +1 with your suggestion, running tests is a little challenge everytime ;)
All ideas are excellent - we will all appreciate!
document teal change in Changelog or write in dev chat
+1 for documenting in changelog maybe by pasting/reusing the
help text of the command.