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 succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). (by mockery)

Mockery Alternatives

Similar projects and alternatives to Mockery

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better Mockery alternative or higher similarity.

Mockery reviews and mentions

Posts with mentions or reviews of Mockery. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-20.
  • I share my authentication server.
    18 projects | | 20 Dec 2021
    Continuous Integration - Testify, sqlmock, Mockery, Github Actions
  • Test doubles
    3 projects | | 18 Mar 2021
    Mockery is another framework for creating test doubles. It can be used with PHPUnit, phpspec, Behat, or any other testing framework. I find it especially powerful when working with legacy code, due to its support for creating partial mocks or mocking hard dependencies.
  • Testing with immutable PSR-7 objects and Prophecy
    3 projects | | 4 Mar 2021
    This works great if a method is tested that modifies and returns an object; we'll get an instance of that object and we are able to run all sorts of assertions on it. But what if this is not the case. What if we have a situation where a value object is passed as a parameter, some modifications are done and the value object is passed to another object. Something like the middleware from the example earlier. Some testing frameworks like Mockery offer spies to test these situations. When using Prophecy this situation can be handled using Argument::that():
  • A note from our sponsor - SonarLint | 31 Mar 2023
    Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today. Learn more →


Basic Mockery repo stats
8 days ago
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives