feat/group-filter Add PHPUnit Group Filtering & Run Support #339
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.
Add PHPUnit Group Filtering & Run Support
Summary
This PR adds support for PHPUnit test groups, enabling users to filter and run tests by group directly from the VS Code Test Explorer.
It supports both traditional
@groupannotations and PHP 8+#[Group]attributes, mapping them into Test Explorer tags and providing a new command to execute grouped tests in a single PHPUnit process.Features
Group Parsing
@groupannotations and#[Group('name')]attributesTest Explorer Integration
@phpUnitTestController:group:
Run Tests by Group
Tag Inheritance
Single Process Execution
--groupflagDemo
📽️ Video walkthrough included, demonstrating:
https://youtu.be/WJf1DIRIcNI
Files Changed
src/PHPUnit/TestParser/AnnotationParser.ts→ Added group parsing support
src/PHPUnit/types.ts→ Added
group?: string[]toAnnotationssrc/TestCollection/TestHierarchyBuilder.ts→ Added
GroupRegistrysingleton→ Assigned group tags with parent → child inheritance
src/CommandHandler.ts→ New
runByGroup()command and picker UIsrc/Handler.ts→ New
startGroupTestRun()using PHPUnit--groupsrc/extension.ts→ Command registration
package.json→ Command contribution
src/PHPUnit/TestParser/PHPUnitParser.test.ts→ Unit tests for group parsing