$this->
assertInstanceOf(CacheableResponseInterface::
class,
$cached_response);
} } $this->
assertTrue($found_cached_200_response);
$this->
assertTrue($other_cached_responses_are_4xx);
} // Sort the serialization data first so we can do an identical comparison
// for the keys with the array order the same (it needs to match with
// identical comparison).
$expected =
$this->
getExpectedNormalizedEntity();
static::
recursiveKSort($expected);
$actual =
$this->serializer->
decode((string) $response->
getBody(),
static::
$format);
static::
recursiveKSort($actual);
$this->
assertEqualsCanonicalizing($expected,
$actual);
// Not only assert the normalization, also assert deserialization of the
// response results in the expected object.
// Note: deserialization of the XML format is not supported, so only test
// this for other formats.
if (static::
$format !== 'xml'
) { $unserialized =
$this->serializer->
deserialize((string) $response->
getBody(),
get_class($this->entity
),
static::
$format);
$this->
assertSame($unserialized->
uuid(),
$this->entity->
uuid());
}