Allow checking versions constraints for arbitrary packages
This realease adds a new step that allows you to conditionally run tests, depending on whether a package satisfies particular version constraints. Constraint syntax is the same as those used by Composer:
Scenario: Running when dependency is satisfied
Given I have the "codeception/module-cli" package satisfying the "*"
And I have the following code
"""
atan("zz");
"""
When I run Psalm
Then I see these errors
| Type | Message |
| InvalidScalarArgument | /./ |
And I see no other errors
You can also check for the version of the module itself:
Scenario: Running when dependency is satisfied
Given I have the "weirdan/codeception-psalm-module" package satisfying the "^0.5 || ^0.6"
And I have the following code
"""
atan("zz");
"""
When I run Psalm
Then I see these errors
| Type | Message |
| InvalidScalarArgument | /./ |
And I see no other errors
Features
- (#20) Added
Given I have the :packageName package satisfying the :versionConstraints
(thanks @adrienlucas) - (#20) Allow querying installed packages from Composer 2+ (thanks @adrienlucas)