diff --git a/core/modules/path/tests/src/Functional/NodeJsonPathTest.php b/core/modules/path/tests/src/Functional/NodeJsonPathTest.php index fe1ea0a..7e6584d 100644 --- a/core/modules/path/tests/src/Functional/NodeJsonPathTest.php +++ b/core/modules/path/tests/src/Functional/NodeJsonPathTest.php @@ -20,6 +20,14 @@ class NodeJsonPathTest extends NodeJsonCookieTest { /** * {@inheritdoc} */ + public function setUp() { + parent::setUp(); + static::$patchProtectedFieldNames[] = 'path'; + } + + /** + * {@inheritdoc} + */ protected function createEntity() { $node = parent::createEntity(); $node->path->alias = '/llama'; diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 992e3b0..da3f670 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -688,7 +688,8 @@ public function testPost() { // 201 for well-formed request. $response = $this->request('POST', $url, $request_options); $this->assertResourceResponse(201, FALSE, $response); - $this->assertSame([str_replace($this->entity->id(), static::$firstCreatedEntityId, $this->entity->toUrl('canonical')->setAbsolute(TRUE)->toString())], $response->getHeader('Location')); + $unserialized = $this->serializer->deserialize((string) $response->getBody(), get_class($this->entity), static::$format); + $this->assertSame([$unserialized->toUrl('canonical')->setAbsolute(TRUE)->toString()], $response->getHeader('Location')); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); @@ -708,7 +709,8 @@ public function testPost() { // 201 for well-formed request. $response = $this->request('POST', $url, $request_options); $this->assertResourceResponse(201, FALSE, $response); - $this->assertSame([str_replace($this->entity->id(), static::$secondCreatedEntityId, $this->entity->toUrl('canonical')->setAbsolute(TRUE)->toString())], $response->getHeader('Location')); + $unserialized = $this->serializer->deserialize((string) $response->getBody(), get_class($this->entity), static::$format); + $this->assertSame([$unserialized->toUrl('canonical')->setAbsolute(TRUE)->toString()], $response->getHeader('Location')); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); }