Mockery
Flexible PHP mock-object framework with Hamcrest-style matchers, supporting partial mocks, static-method mocks and chained expectations.
Our Verdict
The go-to PHP mocking lib when PHPUnit mocks run out of steam, used with the usual mock-overuse caveat.
Pros
- Expressive Hamcrest-style matchers
- Handles partial and static mocks well
- Chained expectations read naturally
- Integrates cleanly with PHPUnit
Cons
- More flexible means easier to misuse
- Static mocks couple tests to globals
- Overlap with PHPUnit's own mocks confuses newcomers
- Debugging failed expectations can be cryptic
When to Use Mockery
Good fit if you need
- PHP mock objects with fluent expectation DSL
- Partial mocks for legacy PHP class isolation
- Static method mocking with overload mocks
- Hamcrest-style matchers for flexible argument assertions
Pricing
Price wrong?Mockery Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- β
- Enterprise Available
- No
- Transparency Score
- β
Beta β estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Project Health
Health Score
10
20 days
16d
115
N/A
BSD-3-Clause
Last checked: 2026-04-21
Lock-in Assessment
π Thinking about migrating off Mockery?
Get an AI-drafted migration plan + a copy-paste email to Mockery support requesting a data export. Pick where you're moving to and tell us your context.
Looking for alternatives to Mockery?
Answer 4 quick questions β get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.