Blame | Letzte Änderung | Log anzeigen | RSS feed
.. index::single: Mocking; Protected MethodsMocking Protected Methods=========================By default, Mockery does not allow mocking protected methods. We do not recommendmocking protected methods, but there are cases when there is no other solution.For those cases we have the ``shouldAllowMockingProtectedMethods()`` method. Itinstructs Mockery to specifically allow mocking of protected methods, for thatone class only:.. code-block:: phpclass MyClass{protected function foo(){}}$mock = \Mockery::mock('MyClass')->shouldAllowMockingProtectedMethods();$mock->shouldReceive('foo');