public function assertJSONFragment(array
$fragment, bool
$strict = false
) { $json =
json_decode($this->
getJSON(), true
);
$this->
assertIsArray($json, 'Response does not have valid json'
);
$patched =
array_replace_recursive($json,
$fragment);
if ($strict) { $this->
assertSame($json,
$patched, 'Response does not contain a matching JSON fragment.'
);
} else { $this->
assertThat($patched,
new IsEqual($json), 'Response does not contain a matching JSON fragment.'
);
} } /**
* Asserts that the JSON exactly matches the passed in data.
* If the value being passed in is a string, it must be a json_encoded string.
*
* @param array|object|string $test
*
* @throws Exception
*/