coduo/phpspec-matcher-extension

This package is abandoned and no longer maintained. No replacement package was suggested.

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

This package is auto-updated.

Last update: 2021-03-20 00:01:38 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.