php-mock/php-mock-phpunit

User Deprecated warnings

stevan-tosic opened this issue · 4 comments

Those warnings are shown when symfony/phpunit-bridge is used, otherwise, there is no warning output.

User Deprecated: The "PHPUnit\Framework\BaseTestListener" class is considered internal. It may change without further notice. You should not use it from "phpmock\phpunit\MockDisablerPHPUnit7".
 
User Deprecated: The "PHPUnit\Framework\BaseTestListener" class is considered internal. It may change without further notice. You should not use it from "phpmock\phpunit\MockDisablerPHPUnit7".
 
User Deprecated: The "PHPUnit\Framework\MockObject\Rule\InvocationOrder" class is considered internal This class is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "phpmock\phpunit\DefaultArgumentRemoverReturnTypes84".

User Deprecated: The "PHPUnit\Framework\MockObject\Rule\InvocationOrder" class is considered internal This class is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from "phpmock\phpunit\DefaultArgumentRemoverReturnTypes84"

See #70 and #71 Thanks.

Ah, actually these are different, sorry 🤦

But yeah, this library is "hacking" into phpunit, to get it working, so we are using some 'internal' phpunit stuff... I guess the only way would be just to silence user deprecations in your project. Not much we can do here 🤷‍♂️

@michalbundyra thank you for the fast response.

I have resolved the warning by migrating to https://github.com/php-mock/php-mock-mockery
(not sure if this can be considered as a solution it was only a few built-in PHP method mocks)