tomzx/ditto
Specification-oriented BDD helpers for PHPUnit
1,795
2
Larablocks Analysis
tomzx/ditto works with Laravel 4 and 5 (latest release v0.2.0, Sep 19, 2015), all past end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 4 and 5, past end of life
- No release in the last 12 months (last: Sep 19, 2015)
- 0 downloads a month (needs 10,000)
- 2 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Sep 19, 2015.
- No releases in the last 12 months.
- First released: Jun 6, 2014.
- 2 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require tomzx/ditto |
|
| Latest Version: | v0.2.0 |
| PHP: | >=5.4 |
| Laravel: | 4 · 5 |
| License: | MIT |
| Last Updated: | Mar 11, 2021 |
| Links: | GitHub · Packagist |
Maintainer: tomzx
Ditto
What is Ditto?
Ditto is a simple wrapper around PHPUnit assertions which allows developers to use a syntax similar to the one provided by phpspec matchers. With it, you can replace your calls to assertSame, assertEquals and assertInstanceOf.
Usage
use Ditto\Ditto as d;
// Before PHP 5.5
$ditto = d::make('SomeClass');
// As of PHP 5.5
$ditto = d::make(SomeClass::class);
$ditto->someMethod()->shouldReturn('some value');
// ===
$ditto->someMethod()->shouldReturn('some value');
$ditto->someMethod()->shouldBe('some value');
$ditto->someMethod()->shouldEqual('some value');
$ditto->someMethod()->shouldBeEqualTo('some value');
// ==
$ditto->someMethod()->shouldBeLike('some value');
// instanceof
$ditto->someMethod()->shouldHaveType('SomeType');
$ditto->someMethod()->shouldReturnAnInstanceOf('SomeType');
$ditto->someMethod()->shouldBeAnInstance('SomeType');
$ditto->someMethod()->shouldImplement('SomeType');
// It also works on intrinsic values
$ditto = d::make('this is nice');
$ditto->shouldReturn('this is nice');
$ditto = d::make(15);
$ditto->shouldBe(15);
Contributing to Ditto
All issues and pull requests should be filed on the tomzx/ditto repository.
License
The code is licensed under the MIT license. See LICENSE.
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.2.0 | >=5.4 | ~4.2| | MIT | |
| v0.1.0 | >=5.4 | ~4.2 | MIT |