edounar/phpspec-json-matcher

PhpSpec matcher 'shouldReturnJson'

1.0.0 2015-01-31 21:37 UTC

This package is not auto-updated.

Last update: 2024-03-16 13:48:13 UTC


README

PhpSpec matcher 'shouldReturnJson'.

Usage

class SomeSpec extends ObjectBehavior
{
    it_should_return_json()
    {
        $this->getJson()->shouldReturnJson('
            {
                "items": ['a', 'b', 'c']
            }
        ');
    }
}

Run phpspec with -v flag to see the difference between actual and expected JSON strings

Installation

Enable the extension in phpspec.yml

extensions:
  - EDounar\PhpSpec\JsonMatcher\Extension