A modern PHP double library that puts developer experience first.
- Zero learning curve — create a
Doubleand start testing immediately. No taxonomy to memorize, no upfront decisions about mocks vs. spies vs. partials. - Failures for humans — no terse output, no internal class identifiers to decode, just a plain-English next step.
- One clean API — a handful of methods, no aliases, no hidden nuance. If you can guess the method name, you're probably right.
- Ready for contribution — small, well-bounded internals mean no reverse-engineering the whole library for your first PR.
composer require --dev jasonmccreary/double$repository = Double::for(BookRepository::class);
$repository->expects('find')->with(123)->returns($book);
$service = new CatalogService($repository);
$service->lookup(123);
$repository->received('recordView')->with($book);Full docs — creating doubles, modes (Loose/Strict/Passthru), argument matching, verification, failure messages, PHPUnit integration, and contributing — live at testdoublephp.com.
Contributions should target the master branch, follow the project's code style, and include tests. See Contributing for the project's standing policies (no aliases, module boundaries, frozen public API) and walkthroughs for adding a matcher or improving a failure message.