diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestMapItemNormalizerTest.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestMapItemNormalizerTest.php index a8ed8597de..754f7e1ab1 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestMapItemNormalizerTest.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestMapItemNormalizerTest.php @@ -29,7 +29,6 @@ class EntityTestMapItemNormalizerTest extends EntityTestResourceTestBase { ], ]; - /** * {@inheritdoc} */ @@ -40,13 +39,8 @@ class EntityTestMapItemNormalizerTest extends EntityTestResourceTestBase { */ protected function getExpectedNormalizedEntity() { $expected = parent::getExpectedNormalizedEntity(); - // The 'non_exposed_value' property in test field type will not return in - // normalization because setExposed(TRUE) was not called for this property. - // @see \Drupal\entity_test\Plugin\Field\FieldType\ExposedPropertyTestFieldItem::propertyDefinitions $expected['field_map'] = [ - [ - 'value' => static::$mapValue, - ], + 0 => static::$mapValue ]; return $expected; } @@ -59,7 +53,7 @@ protected function createEntity() { FieldStorageConfig::create([ 'entity_type' => 'entity_test', 'field_name' => 'field_map', - 'type' => 'map_test', + 'type' => 'map', 'cardinality' => 1, 'translatable' => FALSE, ])->save(); @@ -72,9 +66,7 @@ protected function createEntity() { } $entity = parent::createEntity(); - $entity->field_map = [ - 'value' => static::$mapValue, - ]; + $entity->get('field_map')->set(0, static::$mapValue); $entity->save(); return $entity; } @@ -85,9 +77,7 @@ protected function createEntity() { protected function getNormalizedPostEntity() { return parent::getNormalizedPostEntity() + [ 'field_map' => [ - [ - 'value' => static::$mapValue, - ], + 0 => static::$mapValue, ], ]; }