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

GetOpt in 4.8.20 using each(), deprecated in PHP 7.2 #3247

Closed
nebojsac opened this issue Aug 8, 2018 · 1 comment
Closed

GetOpt in 4.8.20 using each(), deprecated in PHP 7.2 #3247

nebojsac opened this issue Aug 8, 2018 · 1 comment

Comments

@nebojsac
Copy link

nebojsac commented Aug 8, 2018

Q A
PHPUnit version 4.8.20
PHP version 7.2.8
Installation Method Composer

Composer Info for the PHPUnit packages:

phpunit/php-code-coverage         2.2.4   Library that provides collection, processing, 
phpunit/php-file-iterator         1.4.5   FilterIterator implementation that filters 
phpunit/php-text-template         1.2.1   Simple template engine.
phpunit/php-timer                 1.0.9   Utility class for timing
phpunit/php-token-stream          1.4.12  Wrapper around PHP's tokenizer extension.
phpunit/phpunit                   4.8.36  The PHP Unit Testing framework.
phpunit/phpunit-mock-objects      2.3.8   Mock Object library for PHPUnit

We've switched from PHP 7.1 to PHP 7.2, which meant switching CakePHP from 2.9 to 2.10. Which in turn meant switching PHPUnit from 3.7.x to 4.8.x.

Now tests throw up warnings because each() is used in GetOpt.php:

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in ./vendor/phpunit/phpunit/src/Util/Getopt.php on line 38

I get that this is an older version of PHPUnit, so I can work on this, if changes are still accepted for 4.x. I saw that GetOpt will be replaced at some point by Symfony, but even then probably not in this older version.

And thank you for the great work on PHPUnit!

EDIT: I guess I would just backport this one: #2536

@nebojsac
Copy link
Author

nebojsac commented Aug 8, 2018

Actually, just found out that CakePHP 2.10 supports PHPUnit 5.x as well, so no need for this change, in my case. Just needed to change the PHPUnit version in composer to 5.* and run composer update.
Hope this helps others.

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

1 participant