I think you could use PHPUnit's [assertJsonStringEqualsJsonString()](http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertJsonStringEqualsJsonString)