Repository navigation
feat: allow configuring Pest configuration discovery paths - #21
Merged
Merged
Conversation
Add optional pest.configPaths with a nullable list schema and wire it into PestFileDiscoverer. Explicit paths replace analysis paths and the automatic working-directory scan, allowing projects to avoid large data directories and mounted storage during Pest configuration discovery. Preserve existing discovery when unset, retain ancestor configuration and memoization, and allow an empty list to disable configuration discovery. Cover restricted and multiple paths, empty lists, default behavior, and PHPStan dependency injection with regression tests.
Member
|
Could we use a unique temporary directory here instead of the fixed The test suite runs with |
Contributor
Author
|
I hope I got it right, because my brain is a little fried tonight. XD |
Use null coalescing when resolving import aliases so Rector 2.7.0 and PHPStan both accept the discovery code. Replace Scope mocks without expectations with stubs to eliminate PHPUnit notices. Validated the full Composer test suite with fresh dependencies: 525 tests and 646 assertions.
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.
PestFileDiscoverer currently searches PHPStan's analysis paths and the entire working directory recursively for Pest.php files. Large data directories and mounted storage beneath the project root are therefore traversed even when they are outside PHPStan's analysis paths.
Add an optional pest.configPaths setting so projects can restrict configuration discovery to their test directories:
The setting controls Pest.php discovery only. PHPStan continues to analyse its configured paths. Ancestor Pest.php files are still discovered up to the project root, and discovery remains memoized.
The parameter has a schema and is passed through the existing discovery service. Tests cover restricted paths, multiple directories, an empty list, the unchanged default, ancestor configuration and real PHPStan service wiring.
Validation: