资 源 简 介
Yay! Mock
A standalone mock object library for PHP 5 (based on jMock)
Yay! Mock aims to be a test framework-independent mock object library with the most flexibility possible. Based on jMock (Java) it makes expectations based on Invocation signatures rather than just on method names and/or call timings.
Mock objects only contain the methods of the original type they mock. In other words, mock objects created with Yay! Mock do not have any expectation methods embedded inside them; instead they "record" invocations to the context in which they were created.
Yay! Mock encourages dependency injection and loose coupling without pushing you into corners of testing implementation details. It works with any unit testing framework.
Particular features include
Mock interfaces (preferred) or classes
Object identities via type-hints remain integral
Expect invocati