feat: add support for --configuration argument
#54
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.
Summary
This pull request introduces support for passing the --configuration argument to the Pest Type Coverage Plugin, enabling it to correctly detect and load custom PHPUnit configuration files.
Previously, the plugin always relied on default configuration discovery, ignoring the --configuration flag. This made it impossible to specify a custom XML configuration file when running Pest with type coverage enabled.
What’s Changed
src/Plugin.php--configurationargument (if present) from the CLI arguments.ConfigurationSourceDetector::detect()for accurate configuration loading.src/Support/ConfigurationSourceDetector.phpdetect()method to accept an optional$argumentsarray.Builderinitialization to use the provided arguments.Why This Matters
This enhancement improves compatibility with projects that use custom PHPUnit XML configuration paths, ensuring that type coverage detection respects all settings defined in those files (e.g., custom source directories, filters, or test suites).
It brings the behavior of the Pest Type Coverage Plugin in line with how PHPUnit and Pest natively handle CLI configuration flags
Example Usage
The plugin now correctly reads and applies the configuration from the provided XML file.