PHP Classes

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

Recommend this page to a friend!
  Packages of Abed Nego Ragil Putra   Laravel Blogging Platform   vendor/mockery/mockery/docs/reference/magic_methods.rst   Download  
File: vendor/mockery/mockery/docs/reference/magic_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: 687 bytes
 

Contents

Class file image Download
.. index:: single: Mocking; Magic Methods PHP Magic Methods ================= PHP magic methods which are prefixed with a double underscore, e.g. ``__set()``, pose a particular problem in mocking and unit testing in general. It is strongly recommended that unit tests and mock objects do not directly refer to magic methods. Instead, refer only to the virtual methods and properties these magic methods simulate. Following this piece of advice will ensure we are testing the real API of classes and also ensures there is no conflict should Mockery override these magic methods, which it will inevitably do in order to support its role in intercepting method calls and properties.