core/modules/rest/src/Tests/EntityResourceTestBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/rest/src/Tests/EntityResourceTestBase.php b/core/modules/rest/src/Tests/EntityResourceTestBase.php index 7416d16..90e4f93 100644 --- a/core/modules/rest/src/Tests/EntityResourceTestBase.php +++ b/core/modules/rest/src/Tests/EntityResourceTestBase.php @@ -165,8 +165,8 @@ public function testGet() { $response = $e->getResponse(); $this->assertSame(404, $response->getStatusCode()); $this->assertSame([static::$expectedErrorMimeType], $response->getHeader('Content-Type')); - $root_relative_url = str_replace(['987654321', \Drupal::request()->getSchemeAndHttpHost()], ['{' . static::$entityType . '}', ''], $non_existing_entity_url->setAbsolute()->setOption('query', [])->toString()); - $message = ['message' => 'The "' . static::$entityType . '" parameter was not converted for the path "' . $root_relative_url . '" (route name: "rest.entity.' . static::$entityType . '.GET.' . static::$format . '")']; + $path = str_replace('987654321', '{' . static::$entityType . '}', $non_existing_entity_url->setAbsolute()->setOptions(['base_url' => '', 'query' => []])->toString()); + $message = ['message' => 'The "' . static::$entityType . '" parameter was not converted for the path "' . $path . '" (route name: "rest.entity.' . static::$entityType . '.GET.' . static::$format . '")']; // @todo Either add this to \Drupal\serialization\Encoder\JsonEncoder, or // figure out how to let tests specify encoder options, and figure out // whether they should apply to just error responses or to everything.