.../BlockContent/BlockContentResourceTestBase.php | 2 -- .../ContactForm/ContactFormResourceTestBase.php | 2 -- .../EntityTestBundleResourceTestBase.php | 2 -- .../EntityResource/Media/MediaResourceTestBase.php | 17 ++++++++++++----- .../tests/src/Kernel/EntitySerializationTest.php | 7 ++++--- 5 files changed, 16 insertions(+), 14 deletions(-) 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 8b67cc6..dfa7742 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/BlockContent/BlockContentResourceTestBase.php @@ -12,8 +12,6 @@ */ abstract class BlockContentResourceTestBase extends EntityResourceTestBase { - use BcTimestampNormalizerUnixTestTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php index 51e297a..595de0d 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php @@ -8,8 +8,6 @@ abstract class ContactFormResourceTestBase extends EntityResourceTestBase { - use BcTimestampNormalizerUnixTestTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleResourceTestBase.php index f43d877..bb42717 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityTestBundle/EntityTestBundleResourceTestBase.php @@ -8,8 +8,6 @@ abstract class EntityTestBundleResourceTestBase extends EntityResourceTestBase { - use BcTimestampNormalizerUnixTestTrait; - /** * {@inheritdoc} */ diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php index 475a1ca..d829e77 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Media/MediaResourceTestBase.php @@ -11,8 +11,6 @@ abstract class MediaResourceTestBase extends EntityResourceTestBase { - use BcTimestampNormalizerUnixTestTrait; - /** * {@inheritdoc} */ @@ -175,13 +173,22 @@ protected function getExpectedNormalizedEntity() { ], ], 'created' => [ - $this->formatExpectedTimestampItemValues(123456789), + [ + 'value' => (new \DateTime())->setTimestamp(123456789)->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), + 'format' => \DateTime::RFC3339, + ], ], 'changed' => [ - $this->formatExpectedTimestampItemValues($this->entity->getChangedTime()), + [ + 'value' => (new \DateTime())->setTimestamp((int) $this->entity->getChangedTime())->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), + 'format' => \DateTime::RFC3339, + ], ], 'revision_created' => [ - $this->formatExpectedTimestampItemValues((int) $this->entity->getRevisionCreationTime()), + [ + 'value' => (new \DateTime())->setTimestamp((int) $this->entity->getRevisionCreationTime())->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), + 'format' => \DateTime::RFC3339, + ], ], 'default_langcode' => [ [ diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 5b71b93..5bde06b 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -13,8 +13,6 @@ */ class EntitySerializationTest extends NormalizerTestBase { - use BcTimestampNormalizerUnixTestTrait; - /** * Modules to install. * @@ -109,7 +107,10 @@ public function testNormalize() { ['value' => 'entity_test_mulrev'], ], 'created' => [ - $this->formatExpectedTimestampItemValues($this->entity->created->value), + [ + 'value' => (new \DateTime())->setTimestamp((int) $this->entity->get('created')->value)->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339), + 'format' => \DateTime::RFC3339, + ], ], 'user_id' => [ [