Server : Apache System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64 User : tradze ( 1001) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/tradze/public_html/vendor/mockery/mockery/docs/reference/ |
.. index::
single: Mocking; Public Properties
Mocking Public Properties
=========================
Mockery allows us to mock properties in several ways. One way is that we can set
a public property and its value on any mock object. The second is that we can
use the expectation methods ``set()`` and ``andSet()`` to set property values if
that expectation is ever met.
You can read more about :ref:`expectations-setting-public-properties`.
.. note::
In general, Mockery does not support mocking any magic methods since these
are generally not considered a public API (and besides it is a bit difficult
to differentiate them when you badly need them for mocking!). So please mock
virtual properties (those relying on ``__get()`` and ``__set()``) as if they
were actually declared on the class.