public function AttachSourceTest::getDestinationUri in FileField Sources 8
Get destination uri of a .
Parameters
object $file: File.
string $uri_scheme: Uri scheme.
2 calls to AttachSourceTest::getDestinationUri()
- AttachSourceTest::testCopyFileFromAbsolutePath in tests/
src/ Functional/ AttachSourceTest.php - Tests copy file from absolute path.
- AttachSourceTest::testMoveFilesFromRelativePath in tests/
src/ Functional/ AttachSourceTest.php - Tests move relative files with different names.
File
- tests/
src/ Functional/ AttachSourceTest.php, line 81
Class
- AttachSourceTest
- Tests the attach source.
Namespace
Drupal\Tests\filefield_sources\FunctionalCode
public function getDestinationUri($file, $uri_scheme) {
$destination = trim($this
->getFieldSetting('file_directory'), '/');
$destination = PlainTextOutput::renderFromHtml(\Drupal::token()
->replace($destination));
return $uri_scheme . '://' . $destination . '/' . $file->filename;
}