diff --git a/core/modules/hal/tests/src/Functional/EntityResource/BlockContent/BlockContentHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/BlockContent/BlockContentHalJsonAnonTest.php index 6e1938f..d4ee9ab 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/BlockContent/BlockContentHalJsonAnonTest.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/BlockContent/BlockContentHalJsonAnonTest.php @@ -47,69 +47,6 @@ protected function getExpectedNormalizedEntity() { 'href' => $this->baseUrl . '/rest/type/block_content/basic', ], ], - 'body' => [ - [ - 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.', - 'format' => 'plain_text', - 'summary' => NULL, - 'lang' => 'en', - ], - ], - 'changed' => [ - [ - 'value' => $this->entity->getChangedTime(), - 'lang' => 'en', - ], - ], - 'default_langcode' => [ - [ - 'value' => TRUE, - 'lang' => 'en', - ], - ], - 'id' => [ - [ - 'value' => $this->entity->id(), - ], - ], - 'info' => [ - [ - 'value' => 'Llama', - 'lang' => 'en', - ], - ], - 'langcode' => [ - [ - 'value' => 'en', - 'lang' => 'en', - ], - ], - 'revision_created' => [ - [ - 'value' => (int) $this->entity->getRevisionCreationTime(), - ], - ], - 'revision_id' => [ - [ - 'value' => $this->entity->getRevisionId(), - ], - ], - 'revision_translation_affected' => [ - [ - 'value' => TRUE, - 'lang' => 'en', - ], - ], - 'type' => [ - [ - 'target_id' => 'basic', - ], - ], - 'uuid' => [ - [ - 'value' => $this->entity->uuid(), - ], - ], ]; } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php index 417dd0f..f531c38 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php @@ -4,6 +4,7 @@ use Drupal\block_content\Entity\BlockContent; use Drupal\block_content\Entity\BlockContentType; +use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait; use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase; /** @@ -11,6 +12,8 @@ */ abstract class BlockContentResourceTestBase extends EntityResourceTestBase { + use BcTimestampNormalizerUnixTestTrait; + /** * {@inheritdoc} */ @@ -101,9 +104,7 @@ protected function getExpectedNormalizedEntity() { ], 'revision_log' => [], 'changed' => [ - [ - 'value' => $this->entity->getChangedTime(), - ], + $this->formatExpectedTimestampItemValues($this->entity->getChangedTime()), ], 'revision_id' => [ [ @@ -111,9 +112,7 @@ protected function getExpectedNormalizedEntity() { ], ], 'revision_created' => [ - [ - 'value' => (int) $this->entity->getRevisionCreationTime(), - ], + $this->formatExpectedTimestampItemValues((int) $this->entity->getRevisionCreationTime()), ], 'revision_user' => [], 'revision_translation_affected' => [ @@ -148,7 +147,7 @@ protected function getNormalizedPostEntity() { ], 'info' => [ [ - 'value' => 'Llama & ' . $this->randomMachineName(), + 'value' => 'Dramallama', ], ], ];