Mock object design pattern in PHP

Mock objects imitate the behavior of the real objects. They are used in testing, where creating mock objects makes testing simpler and still provides the same behavior as the real object used in the application code. They can also be used as a base while developing a specific part of an application in a team, without utilizing the entire application.


See also

Found a typo? Something wrong with this content?

Just fork and edit it.

Content of this work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. Code snippets in examples are published under the CC0 1.0 Universal (CC0 1.0). Thanks to all contributors.