eugene-dounar / phpspec-json-matcher

PhpSpec matcher 'shouldReturnJson'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON matcher for phpspec

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       

About

PhpSpec matcher 'shouldReturnJson'

License:MIT License


Languages

Language:PHP 100.0%