diff --git a/core/modules/rest/tests/src/Functional/EntityResource/ConfigTest/ConfigTestResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/ConfigTest/ConfigTestResourceTestBase.php index b89a2718dc..c34e8e2b1a 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/ConfigTest/ConfigTestResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/ConfigTest/ConfigTestResourceTestBase.php @@ -32,7 +32,11 @@ /** * {@inheritdoc} */ - protected static $firstCreatedEntityId = 'llama'; + protected static $firstCreatedEntityId = 'llama1'; + + public function setUp() { + parent::setUp(); + } /** * {@inheritdoc} @@ -55,7 +59,7 @@ protected function setUpAuthorization($method) { */ protected function createEntity() { $config_test = ConfigTest::create([ - 'id' => 'llama', + 'id' => 'llama' . (string) $this->counter, 'label' => 'Llama', ]); $config_test->save(); @@ -69,7 +73,7 @@ protected function createEntity() { protected function getExpectedNormalizedEntity() { $normalization = [ 'uuid' => $this->entity->uuid(), - 'id' => 'llama', + 'id' => 'llama' . (string) $this->counter, 'weight' => 0, 'langcode' => 'en', 'status' => TRUE, diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 6345b0b185..6fd975a3a5 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -879,7 +879,7 @@ public function testPost() { foreach ($this->getNormalizedPostEntity() as $field_name => $field_normalization) { // Some top-level keys in the normalization may not be fields on the // entity (for example '_links' and '_embedded' in the HAL normalization). - if ($created_entity->hasField($field_name)) { + if ($created_entity instanceof FieldableEntityInterface && $created_entity->hasField($field_name)) { // Subset, not same, because we can e.g. send just the target_id for the // bundle in a POST request; the response will include more properties. $this->assertArraySubset(static::castToString($field_normalization), $created_entity->get($field_name)->getValue(), TRUE);