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

PHPUnit 8.1.0 breaks static analysis of MockObject usage #3588

Closed
davidkmenta opened this issue Apr 5, 2019 · 13 comments
Closed

PHPUnit 8.1.0 breaks static analysis of MockObject usage #3588

davidkmenta opened this issue Apr 5, 2019 · 13 comments
Labels
type/bug Something is broken

Comments

@davidkmenta
Copy link

Q A
PHPUnit version 8.1
PHP version 7.2
Installation Method Composer

By releasing the 8.1 version of PHPUnit some breaking changes occured. I guess it's due to added strict_types declaration to some interfaces. I know that there was an issue #3236 but still it seems to be undocumented BC... 😢

@sebastianbergmann
Copy link
Owner

Please provide specific information about the breaking change(s).

@davidkmenta
Copy link
Author

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Apr 5, 2019

What part of

> This class is not covered by the backward compatibility promise for PHPUnit

is not clear?

Let me rephrase that: the class in question is (currently) not covered by the backward compatibility promise for PHPUnit.

I still think that it is an internal implementation detail and therefore should not be subject to the backward compatibility promise. If you can show me a valid use case that does not work with PHPUnit 8.1 but did work with PHPUnit 8 then we can discuss whether or not this class should be covered by the BC promise.

@davidkmenta
Copy link
Author

Of course, I get it. Still I'm thinking it should be at least mentioned somewhere in release notes to keep it in sight...

Better way (IMHO) would be deprecate the using of those objects in the version 8 and later (in version 9?) make them incompatible...

@sebastianbergmann
Copy link
Owner

I do not think that changes to implementation details should be covered in release notes.

@davidkmenta
Copy link
Author

davidkmenta commented Apr 5, 2019

@sebastianbergmann it's used by php-mock library: https://github.com/php-mock/php-mock-phpunit/blob/master/classes/DefaultArgumentRemover.php (for example)

Another example is here: 60db534#r33047915

@sebastianbergmann
Copy link
Owner

I do not know what you (or the author(s) of php-mock) expect me to do here: this is the kind of problem you create for yourself when you decide to rely on implementation details of third-party software.

@davidkmenta
Copy link
Author

@sebastianbergmann okay, no problem. So the MockObject interface (https://github.com/sebastianbergmann/phpunit/blob/8.1.0/src/Framework/MockObject/MockObject.php) should be considered as internal too? Because BC was made by removing the @method annotation from the class too.

@sebastianbergmann
Copy link
Owner

Can you explain how the removal of a @method annotation breaks compatibility?

@davidkmenta
Copy link
Author

@sebastianbergmann it's already mentioned by @possi here: 60db534#r33047915

I guess the tools for static analysis used that somehow? :)

@sebastianbergmann
Copy link
Owner

I brought the @method annotation back in 31df2e8.

@Ocramius
Copy link
Sponsor Contributor

Ocramius commented Apr 7, 2019

Is 31df2e8 also targeting a stable release? (Not familiar with PHPUnit's branching model)

@sebastianbergmann
Copy link
Owner

31df2e8 will be part of PHPUnit 8.1.1, the first bugfix release for PHPUnit 8.1.

@sebastianbergmann sebastianbergmann changed the title Version 8.1 introduced some breaking changes PHPUnit 8.1.0 breaks static analysis of MockObject usage Apr 8, 2019
@sebastianbergmann sebastianbergmann added type/bug Something is broken and removed status/waiting-for-feedback Waiting for feedback from original reporter waiting-for-reproducing-example labels Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants