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

verifyMockObjects() is now private #3734

Closed
sylfabre opened this issue Jun 25, 2019 · 4 comments
Closed

verifyMockObjects() is now private #3734

sylfabre opened this issue Jun 25, 2019 · 4 comments

Comments

@sylfabre
Copy link

Q A
PHPUnit version 8.1.6
PHP version 7.2.15
Installation Method Composer

We are migrating from PHPUnit 5 to PHPUnit 8.
And we have discovered that verifyMockObjects() is now a private method.

We use it a lot in our tests like this:

  • set up some context for the test
  • mock some objects
  • run some user-land code
  • assert it works well with verifyMockObjects()
  • mock some more objects
  • run some user-land code
  • assert it works well with verifyMockObjects()
  • ...

An example would be an iterator:

  • we check it once set up
  • we check it after the first loop
  • we check it after the second loop
  • ...

Using verifyMockObjects() helps us to set up some milestone in the test.
Is there a workaround or a best practice we should be aware of since verifyMockObjects() is now private?

Thanks!

@sylfabre
Copy link
Author

sylfabre commented Jul 9, 2019

@sebastianbergmann would you accept a PR to make this method protected instead of private?

@sebastianbergmann
Copy link
Owner

I am sorry that this causes you grief but this will stay private.

@sylfabre
Copy link
Author

sylfabre commented Jul 9, 2019

@sebastianbergmann any workaround or best practice on how to use it in my use case (see my first message about iterator)?

@clement-fleury-assoconnect

@sebastianbergmann any workaround or best practice on how to use it in my use case (see my first message about iterator)?

@sebastianbergmann any answer to this question ?

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

3 participants