2017 © Pedro PelĂĄez
 

library esperance-phpunit

PHPUnit TestCase class integrated with Esperance assertion library.

image

esperance/esperance-phpunit

PHPUnit TestCase class integrated with Esperance assertion library.

  • Friday, July 6, 2012
  • by yuya-takeyama
  • Repository
  • 0 Watchers
  • 1 Stars
  • 75 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Espérance PHPUnit Extension

PHPUnit TestCase class integrated with Espérance assertion library., (*1)

Usage

Installation

Before installation of Espérance-PHPUnit, PHPUnit should be installed., (*2)

Espérance-PHPUnit can be installed using Composer., (*3)

At first, save below as composer.json at the root of your project., (*4)

{
    "require": {
        "esperance/esperance-phpunit": "0.1.*"
    }
}

And run these commands., (*5)

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

Then Espérance would be installed in ./vendor directory and also ./vendor/autoload.php is generated., (*6)

PHPUnit integration

Just replace PHPUnit_Framework_TestCase with \Esperance\PHPUnit\Testcase., (*7)

Then $this->expect() method is available to specify subject for the test., (*8)

<?php
require './vendor/autoload.php';

class YourTestCase extends \Esperance\PHPUnit\TestCase
{
    public function testSomething()
    {
        $this->expect(1 + 1)->to->be(2);
        $this->expect("foo" . "bar")->to->be("foobar")->and->not->to->be('baz');
        $this->expect(new ArrayObject)->to->be->an('ArrayObject');
        $this->expect(function () {
            throw new RuntimeException;
        })->to->throw('RuntimeException');
    }
}

License

The MIT License, (*9)

Author

Yuya Takeyama, (*10)

The Versions

06/07 2012

dev-develop

dev-develop

PHPUnit TestCase class integrated with Esperance assertion library.

  Sources   Download

MIT

The Requires

 

bdd tdd phpunit assertion

06/07 2012

dev-master

9999999-dev

PHPUnit TestCase class integrated with Esperance assertion library.

  Sources   Download

MIT

The Requires

 

bdd tdd phpunit assertion

06/07 2012

v0.1.0

0.1.0.0

PHPUnit TestCase class integrated with Esperance assertion library.

  Sources   Download

MIT

The Requires

 

bdd tdd phpunit assertion

01/07 2012

v0.0.0

0.0.0.0

PHPUnit TestCase class integrated with Esperance assertion library.

  Sources   Download

MIT

The Requires

 

bdd tdd phpunit assertion