Skip to content

Commit

Permalink
Merge pull request #843 from robertbasic/fix/issue660
Browse files Browse the repository at this point in the history
Make it more clear that final methods can't be mocked
  • Loading branch information
davedevelopment committed Feb 5, 2018
2 parents d6ab105 + 877098b commit 88ccae3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/reference/final_methods_classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ However, in a compromise between mocking functionality and type safety,
Mockery does allow creating "proxy mocks" from classes marked final, or from
classes with methods marked final. This offers all the usual mock object
goodness but the resulting mock will not inherit the class type of the object
being mocked, i.e. it will not pass any instanceof comparison.
being mocked, i.e. it will not pass any instanceof comparison. Methods marked
as final will be proxied to the original method, i.e., final methods can't be
mocked.

We can create a proxy mock by passing the instantiated object we wish to
mock into ``\Mockery::mock()``, i.e. Mockery will then generate a Proxy to the
Expand Down

0 comments on commit 88ccae3

Please sign in to comment.