Automattic / VIP-Coding-Standards

PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/
Other
236 stars 40 forks source link

Update PHPUnit dependencies #718

Closed anigeluk closed 1 year ago

anigeluk commented 2 years ago

https://github.com/Automattic/VIP-Coding-Standards/blob/796580706adaaf73a3a40e4c92a64dc9aaa0b700/composer.json#L29

We've had a customer report an issue with the PHPUnit version requirements in composer. Where up to version ^7 is required PHP 7 is required.

They are trying to update to PHP8 which then fails the dependency as PHPUnit ^7 depends on PHP 7

Can we please add ^8

Thanks

jrfnl commented 2 years ago

We've had a customer report an issue with the PHPUnit version requirements in composer. Where up to version ^7 is required PHP 7 is required.

@anigeluk Could you please provide more information as that sounds like the customer is doing something wrong.

The dev requirements for dependencies will not be taken into account by Composer when resolving dependencies, so the VIPCS PHPUnit requirement should never limit any of the VIP customers from updating their own PHPUnit dependency.

If it would be possible to share the complete composer.json file of the customer, I can try and pinpoint the problem more precisely and give them some guidance. If you cannot share it in this public space, you could possibly share it in the #vip-phpcs channel on Slack ?

Can we please add ^8

Unfortunately that is not possible unless we create our own test framework for VIPCS. The test framework currently used is based on PHP_CodeSniffer itself and has to stay compliant with the requirements from PHPCS, which currently doesn't allow for PHPUnit > 7.

jrfnl commented 1 year ago

As there has been no additional information provided, I'm presuming this issue can be closed.

Note: while widening the supported PHPUnit version wouldn't solve the above reported issue anyway, it should be possible to do so once squizlabs/PHP_CodeSniffer#3803 has been merged, but there is no timeline available for when that will be.