FindSoftware

Mockery

PHP mock object framework for creating test doubles with a readable API in unit tests run with PHPUnit, PHPSpec or another testing framework.

Mockery is a PHP mock object framework for creating test doubles in unit tests. Its documentation describes it as usable with PHPUnit, PHPSpec or any other testing framework. It is installed as a development dependency with Composer, or by cloning its repository. The project describes itself as a drop-in alternative to PHPUnit’s phpunit-mock-objects library and says it can run alongside that library.

Worth knowing

The README says some of Mockery’s internals are private and may change at any time, so a class that is not final, or a method that is not private, is not necessarily part of the API the versioning scheme covers.

Identity

Status
Active
Maintainer
Pádraic Brady5
First release
20104

Rendering and deploy

Install with
composer, git37

Releases

Current major version
18
Last release
2026-08-198

Adoption

GitHub stars
10,7222
Packagist downloads
595,145,42010
Contributors
2009
Dependent repositories
482,49211
Dependent packages
22,33111

Why these figures do not compare

Sources

  1. 2026-11-16: links, Categories, Runtime
    docs.mockery.io/en/stable/
  2. 2026-11-16: links, Written in, License model, GitHub stars
    api.github.com/repos/mockery/mockery
  3. 2026-11-16: links, Install with
    github.com/mockery/mockery/blob/1.6.x/README.md
  4. 2026-11-16: First release
    api.github.com/repos/mockery/mockery/commits/0.6.0
  5. 2026-11-16: Maintainer, License
    github.com/mockery/mockery/blob/1.6.x/LICENSE
  6. 2026-11-16: Minimum runtime
    repo.packagist.org/p2/mockery/mockery.json
  7. 2026-11-16: Install with
    docs.mockery.io/en/stable/getting_started/installation.html
  8. 2026-11-16: Current major version, Last release
    api.github.com/repos/mockery/mockery/releases/tags/1.6.15
  9. 2026-11-16: Contributors
    api.github.com/repos/mockery/mockery/contributors?per_page=1
  10. 2026-11-16: Packagist downloads
    packagist.org/packages/mockery/mockery.json
  11. 2026-11-16: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/packagist.org/packages/mockery%2Fmockery

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON