/home/techb158/ileadtechnology.com/vendor/mockery/mockery/docs/reference
NameSizeModeActions
alternative_should_receive_syntax.rst23810644editdlrm
argument_validation.rst107430644editdlrm
creating_test_doubles.rst144610644editdlrm
demeter_chains.rst16390644editdlrm
expectations.rst151260644editdlrm
final_methods_classes.rst13190644editdlrm
index.rst4000644editdlrm
instance_mocking.rst8050644editdlrm
magic_methods.rst6870644editdlrm
map.rst.inc5500644editdlrm
partial_mocks.rst42860644editdlrm
pass_by_reference_behaviours.rst43220644editdlrm
phpunit_integration.rst50050644editdlrm
protected_methods.rst6680644editdlrm
public_properties.rst8210644editdlrm
public_static_properties.rst7010644editdlrm
spies.rst47370644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/mockery/mockery/docs/reference/final_methods_classes.rst (1319B)
.. index:: single: Mocking; Final Classes/Methods Dealing with Final Classes/Methods ================================== One of the primary restrictions of mock objects in PHP, is that mocking classes or methods marked final is hard. The final keyword prevents methods so marked from being replaced in subclasses (subclassing is how mock objects can inherit the type of the class or object being mocked). The simplest solution is to not mark classes or methods as final! 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. 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 real object and selectively intercept method calls for the purposes of setting and meeting expectations. See the :ref:`creating-test-doubles-partial-test-doubles` chapter, the subsection about proxied partial test doubles.