Skip to content

Make tests PHP & PHPUnit cross-version compatible ? #15

@jrfnl

Description

@jrfnl

I noticed PR #10 which is sort of about the same, though it would inhibit the tests from being run on PHP 5.6, which is still listed in the Travis script.

The short of it is that it will be neigh impossible to get the tests running on PHP 8.1 with PHPUnit 7.x, which is the current setup.

As this package still supports older PHP versions, it would be opportune to make the cross-version compatible.

This can be done in various ways, though I'd like to suggest to use the PHPUnit Polyfills, though I'm biased 😂 (I wrote that package).

The PHPUnit Polyfills package can sort out most issues, in particular it:

  • Polyfills all assertions and expectation methods introduced in PHPUnit since PHPUnit 5.0 to current (PHPUnit 9.5). This allows for the test suite to use the currently available set of assertion and expectation methods, while allowing the tests to still run on PHPUnit 4.x-8.x.
  • Includes a TestCase which can be extended with a solution for the void return type being added in PHPUnit 8.
  • Includes a PHPUnit cross-version compatible way of implementing TestListeners.

I haven't looked at the tests in-depth yet, but I suspect that the Polyfills package can sort out most, if not all, issues for making the test suite cross-version compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions