Skip to content

Allow checking versions constraints for arbitrary packages

Compare
Choose a tag to compare
@weirdan weirdan released this 28 Aug 21:44
· 58 commits to master since this release
1b6f2d1

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)