rectorphp / rector-phpunit

Rector upgrade rules for PHPUnit
https://getrector.com/find-rule?activeRectorSetGroup=phpunit
MIT License
64 stars 47 forks source link

Missing deprecation from phpunit 10? #292

Closed bbrala closed 11 months ago

bbrala commented 11 months ago

It seems setMethods on mockBuilder is deprecated in PHPUNIT 10, this rule is currently under the codestyle setlist, but it seems it should be in the phpunit10 setlist? Am i missing something?

https://github.com/sebastianbergmann/phpunit/pull/3687

RemoveSetMethodsMethodCallRector::class, is the class im talking about.

TomasVotruba commented 11 months ago

You're right :+1: Could you add it to particular set?

bbrala commented 11 months ago

Hmm, the thing is though. The rector is pretty simple, just remove it. But seems like it is technically a little different.

Its has been deprecated in phpunit https://github.com/sebastianbergmann/phpunit/commit/d618fa3fda437421264dcfa1413a474f306f79c4 so should we fix it since phpunit 8?

Also there are alternatives as mentioned here: https://github.com/sebastianbergmann/phpunit/pull/3687 (with somemore deprecation info).

What should rector do? Remove usage from 8 and up? Or even make the replacement better, although im not sure it is even possible since the signatures are a little different.

bbrala commented 11 months ago

Opened a PR which moves it to the phpunit_100 setlist