Select the tests that are in all of several groups - #6958
Closed
sebastianbergmann wants to merge 1 commit into
Closed
Select the tests that are in all of several groups#6958sebastianbergmann wants to merge 1 commit into
sebastianbergmann wants to merge 1 commit into
Conversation
…t tests that are in both groups
sebastianbergmann
force-pushed
the
feature/group-conjunctions
branch
from
September 4, 2026 09:39
4da50de to
f415f97
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6958 +/- ##
=========================================
Coverage 99.46% 99.46%
- Complexity 9614 9639 +25
=========================================
Files 936 937 +1
Lines 29306 29374 +68
=========================================
+ Hits 29150 29218 +68
Misses 156 156 ☔ View full report in Codecov by Harness. |
sebastianbergmann
added a commit
to sebastianbergmann/phpunit-documentation-english
that referenced
this pull request
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groups can be combined with
--groupand--exclude-grouptoday, but only one way: a test is selected when it is in any of the groups that were named. There is no way to ask for the tests that are in all of them.This proposes to add support for separating group names with
+to select the tests that are in every one of them:This runs only the tests that are in the group
databaseand in the groupslow. A test that is in only one of the two is not run.What you can do with it
Any number of groups can be combined:
A combination can be used wherever a single group name can be used, so both ways of combining groups can be mixed. Each value of the option is a set of groups a test has to be in, and a test is selected when it matches at least one of those values:
This runs the tests that are in both
databaseandslow, as well as the tests that are insmoke.--exclude-groupworks the same way:This runs everything except the tests that are in both
databaseandslow. A test that is only indatabase, or only inslow, still runs.The
<groups>element of the XML configuration file accepts the same syntax:What this means for group names
+cannot be both an operator and an ordinary character in a group name. A group nameddatabase+slowcan no longer be selected by that name:--group database+slownow asks for the tests that are indatabaseand inslow.So that this cannot happen silently, PHPUnit emits a warning where such a group name is declared: with the
Groupattribute, or with thegroupsattribute of a<directory>or<file>element in the XML configuration file. The group is still assigned to the test; only selecting it by name is no longer possible.A
+is only treated as an operator between two group names.+name,name+, and+remain ordinary group names and can be selected as before, so a name is only affected when it has a+between two other characters.