PHP Classes

File: vendor/mockery/mockery/docs/reference/protected_methods.rst

Recommend this page to a friend!
  Packages of Abed Nego Ragil Putra   Laravel Blogging Platform   vendor/mockery/mockery/docs/reference/protected_methods.rst   Download  
File: vendor/mockery/mockery/docs/reference/protected_methods.rst
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Blogging Platform
Manage blog posts using Laravel and Bootstrap
Author: By
Last change:
Date: 8 months ago
Size: 668 bytes
 

Contents

Class file image Download
.. index:: single: Mocking; Protected Methods Mocking Protected Methods ========================= By default, Mockery does not allow mocking protected methods. We do not recommend mocking protected methods, but there are cases when there is no other solution. For those cases we have the ``shouldAllowMockingProtectedMethods()`` method. It instructs Mockery to specifically allow mocking of protected methods, for that one class only: .. code-block:: php class MyClass { protected function foo() { } } $mock = \Mockery::mock('MyClass') ->shouldAllowMockingProtectedMethods(); $mock->shouldReceive('foo');