diff --git a/core/modules/file/tests/src/Kernel/FileUriItemTest.php b/core/modules/file/tests/src/Kernel/FileUriItemTest.php index 1e87fab64a..d67eba0707 100644 --- a/core/modules/file/tests/src/Kernel/FileUriItemTest.php +++ b/core/modules/file/tests/src/Kernel/FileUriItemTest.php @@ -33,7 +33,7 @@ public function testCustomFileUriField() { $file->save(); $this->assertSame($uri, $file->uri->value); - $expected_url = file_transform_relative(file_create_url($uri)); + $expected_url = base_path() . $this->siteDirectory . '/files/druplicon.txt'; $this->assertSame($expected_url, $file->uri->url); } diff --git a/core/modules/file/tests/src/Unit/ComputedFileUrlTest.php b/core/modules/file/tests/src/Unit/ComputedFileUrlTest.php index 459f154ba3..8e2a4a469e 100644 --- a/core/modules/file/tests/src/Unit/ComputedFileUrlTest.php +++ b/core/modules/file/tests/src/Unit/ComputedFileUrlTest.php @@ -39,7 +39,7 @@ public function testGetValue() { $typed_data = new ComputedFileUrl($definition->reveal(), $this->randomMachineName(), $parent->reveal()); - $expected = file_transform_relative(file_create_url($this->testUrl)); + $expected = base_path() . $this->siteDirectory . '/files/druplicon.txt'; $this->assertSame($expected, $typed_data->getValue()); // Do this a second time to confirm the same value is returned but the value diff --git a/core/modules/hal/tests/src/Functional/EntityResource/File/FileHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/File/FileHalJsonAnonTest.php index ac21d26e38..f345a64dfa 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/File/FileHalJsonAnonTest.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/File/FileHalJsonAnonTest.php @@ -143,7 +143,7 @@ public function testGetBcUriField() { // Explicitly assert that $file->uri->value is an absolute file URL, unlike // the default normalization. - $this->assertSame(file_create_url('public://drupal.txt'), $actual['uri'][0]['value']); + $this->assertSame($this->baseUrl . '/' . $this->siteDirectory . '/files/drupal.txt', $actual['uri'][0]['value']); } /**