Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Latest Stable Version License

Double

A modern PHP double library that puts developer experience first.

  • Zero learning curve — create a Double and 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.

Installation

composer require --dev jasonmccreary/double

Usage

$repository = Double::for(BookRepository::class);
$repository->expects('find')->with(123)->returns($book);

$service = new CatalogService($repository);
$service->lookup(123);

$repository->received('recordView')->with($book);

Documentation

Full docs — creating doubles, modes (Loose/Strict/Passthru), argument matching, verification, failure messages, PHPUnit integration, and contributing — live at testdoublephp.com.

Contributing

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.

About

A modern PHP test double library that puts developer experience first.

Topics

Resources

Stars

15 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages