用于php单元测试的理想存根实用程序

I am looking utility for the stubs for unit testing in php. Stub must meet typehinting. Must be able to check the method calls with parameters. Must be able to return values ​​according to the specified parameters. Do you know any?

Mockery is a great option:

From GitHub padraic / mockery

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.

Mockery is released under a New BSD License.