X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fserialization%2Ftests%2Fsrc%2FKernel%2FEntitySerializationTest.php;h=5b71b93b7a1487f6bdaa33c76243351da9b15bd0;hp=71fa6b3ec584d83f3c46b67de1bc15aa961c44bd;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/web/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 71fa6b3ec..5b71b93b7 100644 --- a/web/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/web/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\serialization\Kernel; use Drupal\Component\Utility\SafeMarkup; use Drupal\entity_test\Entity\EntityTestMulRev; +use Drupal\Tests\rest\Functional\BcTimestampNormalizerUnixTestTrait; /** * Tests that entities can be serialized to supported core formats. @@ -12,6 +13,8 @@ use Drupal\entity_test\Entity\EntityTestMulRev; */ class EntitySerializationTest extends NormalizerTestBase { + use BcTimestampNormalizerUnixTestTrait; + /** * Modules to install. * @@ -106,7 +109,7 @@ class EntitySerializationTest extends NormalizerTestBase { ['value' => 'entity_test_mulrev'], ], 'created' => [ - ['value' => $this->entity->created->value], + $this->formatExpectedTimestampItemValues($this->entity->created->value), ], 'user_id' => [ [ @@ -123,6 +126,9 @@ class EntitySerializationTest extends NormalizerTestBase { 'default_langcode' => [ ['value' => TRUE], ], + 'revision_translation_affected' => [ + ['value' => TRUE], + ], 'non_rev_field' => [], 'field_test_text' => [ [ @@ -182,16 +188,19 @@ class EntitySerializationTest extends NormalizerTestBase { // Generate the expected xml in a way that allows changes to entity property // order. + $expected_created = $this->formatExpectedTimestampItemValues($this->entity->created->value); + $expected = [ 'id' => '' . $this->entity->id() . '', 'uuid' => '' . $this->entity->uuid() . '', 'langcode' => 'en', 'name' => '' . $this->values['name'] . '', 'type' => 'entity_test_mulrev', - 'created' => '' . $this->entity->created->value . '', + 'created' => '' . $expected_created['value'] . '' . $expected_created['format'] . '', 'user_id' => '' . $this->user->id() . '' . $this->user->getEntityTypeId() . '' . $this->user->uuid() . '' . $this->user->url() . '', 'revision_id' => '' . $this->entity->getRevisionId() . '', 'default_langcode' => '1', + 'revision_translation_affected' => '1', 'non_rev_field' => '', 'field_test_text' => '' . $this->values['field_test_text']['value'] . '' . $this->values['field_test_text']['format'] . '', ];