diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index b358146d65..3362df4f16 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -743,11 +743,6 @@ public function testPost() { $this->assertFalse($response->hasHeader('X-Drupal-Cache')); - // DX: 409 when POSTing to an existing entity. - $response = $this->request('POST', $this->getUrl(), $request_options); - $this->assertResourceResponse(409, 'Some useful message', $response); - - $this->config('rest.settings')->set('bc_entity_resource_permissions', TRUE)->save(TRUE); $this->refreshTestStateAfterRestConfigChange(); $request_options[RequestOptions::BODY] = $parseable_valid_request_body_2; @@ -761,6 +756,11 @@ public function testPost() { $this->grantPermissionsToTestedRole(['restful post entity:' . static::$entityTypeId]); + // DX: 409 when POSTing to an existing entity. + $response = $this->request('POST', $this->getUrl(), $request_options); + $this->assertResourceResponse(409, 'Some useful message', $response); + + // 201 for well-formed request. // Delete the first created entity in case there is a uniqueness constraint. $this->entityStorage->load(static::$firstCreatedEntityId)->delete();