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

Fix mocking with classes that use HHVM memoization #893

Merged
merged 1 commit into from
Jul 6, 2018
Merged

Fix mocking with classes that use HHVM memoization #893

merged 1 commit into from
Jul 6, 2018

Conversation

karoun
Copy link
Contributor

@karoun karoun commented Jun 8, 2018

HHVM has a built-in decorator that memoizes class methods. However, its implementation is incompatible with the code generation/evaluation strategy that Mockery uses.

This PR fixes Mockery to allow mocking of classes that use the decorator, though with the caveat that the decorator will no longer function as advertised. This is regrettable, but memoization (as implemented by HHVM) is solely a means of improving performance, and so disabling it in tests should not greatly affect behavior.

@karoun
Copy link
Contributor Author

karoun commented Jul 3, 2018

@davedevelopment sorry for the Git noob-ery here - this is my replacement PR for #892. Any chance it could get merged?

@davedevelopment davedevelopment merged commit 80a3a50 into mockery:master Jul 6, 2018
@davedevelopment
Copy link
Collaborator

No worries at all, thanks for the contribution.

@karoun karoun deleted the karoun/support-hhvm-memoization branch July 8, 2018 03:24
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

Successfully merging this pull request may close these issues.

None yet

2 participants