X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffile%2Ftests%2Fsrc%2FKernel%2FFileUrlTest.php;fp=web%2Fcore%2Fmodules%2Ffile%2Ftests%2Fsrc%2FKernel%2FFileUrlTest.php;h=573fe25444143a762d438af68fb828328ed7b639;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/file/tests/src/Kernel/FileUrlTest.php b/web/core/modules/file/tests/src/Kernel/FileUrlTest.php new file mode 100644 index 000000000..573fe2544 --- /dev/null +++ b/web/core/modules/file/tests/src/Kernel/FileUrlTest.php @@ -0,0 +1,27 @@ +setSetting('file_public_base_url', $test_base_url); + $filepath = file_create_filename('test.txt', ''); + $directory_uri = 'public://' . dirname($filepath); + file_prepare_directory($directory_uri, FILE_CREATE_DIRECTORY); + $file = $this->createFile($filepath, NULL, 'public'); + $url = file_create_url($file->getFileUri()); + $expected_url = $test_base_url . '/' . basename($filepath); + $this->assertSame($url, $expected_url); + } + +}