PATH:
home
/
lab2454c
/
tripvare.com
/
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.
[-] map.rst.inc
[edit]
[-] partial_mocks.rst
[edit]
[-] public_static_properties.rst
[edit]
[-] spies.rst
[edit]
[+]
..
[-] expectations.rst
[edit]
[-] creating_test_doubles.rst
[edit]
[-] phpunit_integration.rst
[edit]
[-] argument_validation.rst
[edit]
[-] final_methods_classes.rst
[edit]
[-] instance_mocking.rst
[edit]
[-] demeter_chains.rst
[edit]
[-] index.rst
[edit]
[-] alternative_should_receive_syntax.rst
[edit]
[-] magic_methods.rst
[edit]
[-] pass_by_reference_behaviours.rst
[edit]
[-] protected_methods.rst
[edit]
[-] public_properties.rst
[edit]