JSON matcher for phpspec
PhpSpec matcher 'shouldReturnJson'.
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
Enable the extension in phpspec.yml
extensions:
- EDounar\PhpSpec\JsonMatcher\Extension