PHPUnit Mock

Mock Objects

The practice of replacing an object with a test double that verifies expectations, for instance asserting that a method has been called, is referred to as mocking.

You can use a mock object "as an observation point that is used to verify the indirect outputs of the SUT as it is exercised. Typically, the mock object also includes the functionality of a test stub in that it must return values to the SUT if it hasn't already failed the tests but the emphasis is on the verification of the indirect outputs. Therefore, a mock object is a lot more than just a test stub plus assertions; it is used in a fundamentally different way" (Gerard Meszaros).

 

 system under test (SUT)

Latest Post

Popular Post

Our Skills

Author

Project Director Information Architect Database Administrator Unix Administrator Senior Developer Project Manager Product Manager Web Marketer Cloud Engineer

Contact Us

For any questions or project ideas please contact me at the following.

I'm here