Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatibility with PHP_Timer #3008

Closed
keradus opened this issue Feb 13, 2018 · 3 comments
Closed

incompatibility with PHP_Timer #3008

keradus opened this issue Feb 13, 2018 · 3 comments

Comments

@keradus
Copy link
Contributor

keradus commented Feb 13, 2018

Q A
PHPUnit version ~4.7.0 || ~5.0.0 || ~5.1.0 || ~5.2.0
PHP version not related
Installation Method composer

PHP Timer v2 has been released. It is incompatible with mentioned PHPUnit, as PHPUnit with given version requires... >= 1 instead of ^1. For that, any new installation of that PHPUnit (in legacy project) will crash during execution with:
https://travis-ci.org/PHPUnitGoodPractices/Traits/jobs/341148960#L978

PHP Fatal error: Uncaught Error: Class 'PHP_Timer' not found in /home/travis/build/PHPUnitGoodPractices/Traits/vendor/phpunit/phpunit/src/Framework/TestResult.php:577

It will hit especially legacy PHP projects that cannot afford upgrading PHPUnit directly.

Yes, I do know that this will be taken as issue of not-maintained version and for that could be closed out of the box, yet it's in the end issue that php-timer major has been just released.

@keradus
Copy link
Contributor Author

keradus commented Feb 13, 2018

Solution for sad users of affected legacy PHPUnit versions:

add to your composer.json:

    "conflict": {
        "phpunit/php-timer": ">=2",
    }

this will basically make PHPUnit reuirement of php-timer to be ^1, like it is in other PHPUnit versions

@sebastianbergmann
Copy link
Owner

PHPUnit 4.7 unfortunately has "phpunit/php-timer": ">=1.0.6" in its composer.json. However, PHPUnit 4.7 was superseded by PHPUnit 4.8 long ago. There is no reason not to update from PHPUnit 4.7 to PHPUnit 4.8. PHPUnit 4.8 has "phpunit/php-timer": "^1.0.6" in its composer.json.

You also mention PHPUnit 5.0, PHPUnit 5.1, and PHPUnit 5.2. All these versions have "phpunit/php-timer": "^1.0.6" in their composer.json.

What do you expect me to do here? Release a new version of PHPUnit 4.7 that has an updated composer.json? Sorry, but that won't happen. The solution you provided in #3008 (comment) should be good enough. Of course, the right solution would be to update to at least PHPUnit 4.8 or use a PHAR of PHPUnit 4.7.

@keradus
Copy link
Contributor Author

keradus commented Feb 14, 2018

You also mention PHPUnit 5.0, PHPUnit 5.1, and PHPUnit 5.2. All these versions have "phpunit/php-timer": "^1.0.6" in their composer.json.

no, 5.2.x-dev has phpunit/php-timer: ^1.0.6,
but last stable release of 5.2,
5.2.12 has phpunit/php-timer: >=1.0.6
for that 5.0.x, 5.1.x and 5.2.x are also affected.

PHP Timer has just been release, the release fact brought issue to legacy PHPUnit that I hit hard at my company and side projects, so purpose of this thread was to raise issue (so it could be found by users who also hit it) and provide possible workaround.

As I said in initial post, I don't expect new release of phpunit 4/5. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants