coduo/phpspec-matcher-extension

dev-master / 1.0.x-dev 2014-09-15 21:01 UTC

README

This extension integrate Coduo PHP Matcher into PHPSpec

##Installation

Add to your composer.json

require: {
   "coduo/phpspec-matcher-extension": "dev-master"
}

##Usage

Configure phpspec

# phpspec.yml
extensions:
  - Coduo\PhpSpec\Matcher\Extension

Write spec:

<?php

namespace spec\Coduo;

use PhpSpec\ObjectBehavior;

class UserSpec extends ObjectBehavior
{
    function it_always_have_salt()
    {
        $this->getSalt()->shouldMatchPattern('@string@');
        $this->getSalt()->shouldNotMatchPattern('@integer@');
    }
}

From now you should be able to use additional matcher matchPattern in PHPSpec.