Tests the supportsNormalization function.
public function testSupportsNormalization() {
$format = static::$format;
$supportedEntity = entity_create('entity_test', array());
$unsupportedEntity = new ConfigEntityTest();
$field = $supportedEntity
->get('uuid');
$entityreferenceField = $supportedEntity
->get('user_id');
// Supported entity.
$this
->assertTrue($this->normalizers['entity']
->supportsNormalization($supportedEntity, static::$format), "Entity normalization is supported for {$format} on content entities.");
// Unsupported entity.
$this
->assertFalse($this->normalizers['entity']
->supportsNormalization($unsupportedEntity, static::$format), "Normalization is not supported for other entity types.");
// Field item.
$this
->assertTrue($this->normalizers['field_item']
->supportsNormalization($field
->offsetGet(0), static::$format), "Field item normalization is supported for {$format}.");
// Entity reference field item.
$this
->assertTrue($this->normalizers['entityreference']
->supportsNormalization($entityreferenceField
->offsetGet(0), static::$format), "Entity reference field item normalization is supported for {$format}.");
}