douyiqi9640 2012-10-31 22:57
浏览 103

用于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?

  • 写回答

1条回答 默认 最新

  • dsedug8644 2012-10-31 23:06
    关注

    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.

    评论

报告相同问题?