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

Compatibility with PHPUnit 7.4 #29

Closed
remicollet opened this issue Oct 5, 2018 · 5 comments
Closed

Compatibility with PHPUnit 7.4 #29

remicollet opened this issue Oct 5, 2018 · 5 comments

Comments

@remicollet
Copy link

Running zend-ldap test suite

Fatal error: Declaration of phpmock\phpunit\MockObjectProxy::__phpunit_verify() must be compatible with PHPUnit_Framework_MockObject_MockObject::__phpunit_verify(bool $unsetInvocationMocker = true) in ...

@remicollet
Copy link
Author

@sebastianbergmann FYI

@sebastianbergmann
Copy link

That is why one should not depend on private implementation details.

@chrisminett
Copy link
Contributor

My first thought was that this might be similar to when this project failed to work against the minor update to PHPUnit 6.5 sebastianbergmann/phpunit-mock-objects#390 . In that case however, the underlying phpunit-mock-objects had a major version increase to v5.0.0 and the fix was not so simple: #20

This time a public method on the MockObject interface has changed its signature in a minor version of PHPUnit, which does seem like a BC break as any implementation of this method will no longer be compatible.

Fortunately updating the method signature in this project will work with PHPUnit 7.3 and 7.4 as the extra parameter in the implementation does not affect compatibility with the lack of the parameter in PHPUnit 7.3:

interface A {
    public function foo();
}
class B {
    public function foo(bool $newParam = true) {
        echo 'bar';
    }
}
(new B())->foo();

michalbundyra added a commit that referenced this issue Oct 7, 2018
Update __phpunit_verify() method signature for PHPUnit 7.4

Closes #30
Fixes #29
@michalbundyra
Copy link
Member

Fixed in #30 and released in version 2.1.2.

@remicollet
Copy link
Author

I confirm the fix is ok.
Thanks for the quick fix.

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

4 participants