2017 © Pedro Peláez
 

library ditto

Specification-oriented BDD helpers for PHPUnit

image

tomzx/ditto

Specification-oriented BDD helpers for PHPUnit

  • Saturday, September 19, 2015
  • by tomzx
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,539 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

Ditto

License Latest Stable Version Latest Unstable Version Build Status Code Quality Code Coverage Total Downloads, (*1)

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., (*2)

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., (*3)

License

The code is licensed under the MIT license. See LICENSE., (*4)

The Versions

19/09 2015

dev-master

9999999-dev https://github.com/tomzx/ditto

Specification-oriented BDD helpers for PHPUnit

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd test ditto

19/09 2015

v0.2.0

0.2.0.0 https://github.com/tomzx/ditto

Specification-oriented BDD helpers for PHPUnit

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd test ditto

02/08 2015

dev-fixes/phpunit

dev-fixes/phpunit https://github.com/tomzx/ditto

Specification-oriented BDD helpers for PHPUnit

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd test ditto

06/06 2014

v0.1.0

0.1.0.0

Specification-oriented BDD helpers for PHPUnit

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd test ditto