-
-
Notifications
You must be signed in to change notification settings - Fork 140
@requires PHP
not working with equal sign with minors or majors
#213
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
Comments
PHPUnit uses PHP's
I agree that the documentation should be updated to reflect this. |
@sebastianbergmann I suspected as much ;-) Thanks for getting back to me. Documentation change looks good. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Based on the documentation for the
@requires
tag:and
... I'd expect to be able to use
@requires PHP = 7.4
to run a particular test only on PHP 7.4.x, but that doesn't seem to work.Ref: https://phpunit.readthedocs.io/en/9.5/incomplete-and-skipped-tests.html#skipping-tests-using-requires
Current behavior
Test is always skipped, independently of the PHP version.
How to reproduce
Using PHP 7.4.x, run
phpunit RunsOnlyOnPHP74.php
where theRunsOnlyOnPHP74.php
file contains the below content.Both tests will be skipped.
Expected behavior
That both tests would run on any PHP 7.4 version, but not on any other PHP version.
Additional information
@requires PHP = 7.4.13
does work, it's only minors and majors which don't.@requires PHP 7.4
is not an option as in that case, the test would also be run on PHP 8.0, which is explicitly not the intent.$this->markTestSkipped()
.If this is just not supported, this could be regarded as a feature request.
If the feature request would be rejected, I'd suggest updating the documentation to make it explicit that this type of use is not supported.
The text was updated successfully, but these errors were encountered: