You are here

protected function XmlEntityNormalizationQuirksTrait::getExpectedNormalizedEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php \Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait::getExpectedNormalizedEntity()
  2. 9 core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php \Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait::getExpectedNormalizedEntity()

File

core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php, line 29

Class

XmlEntityNormalizationQuirksTrait
Trait for EntityResourceTestBase subclasses testing $format='xml'.

Namespace

Drupal\Tests\rest\Functional\EntityResource

Code

protected function getExpectedNormalizedEntity() {
  $default_normalization = parent::getExpectedNormalizedEntity();
  if ($this->entity instanceof FieldableEntityInterface) {
    $normalization = $this
      ->applyXmlFieldDecodingQuirks($default_normalization);
  }
  else {
    $normalization = $this
      ->applyXmlConfigEntityDecodingQuirks($default_normalization);
  }
  $normalization = $this
    ->applyXmlDecodingQuirks($normalization);
  return $normalization;
}