You are here

public function AttachSourceTest::getCustomAttachPath in FileField Sources 8

Calculate custom absolute path.

1 call to AttachSourceTest::getCustomAttachPath()
AttachSourceTest::testCopyFileFromAbsolutePath in tests/src/Functional/AttachSourceTest.php
Tests copy file from absolute path.

File

tests/src/Functional/AttachSourceTest.php, line 181

Class

AttachSourceTest
Tests the attach source.

Namespace

Drupal\Tests\filefield_sources\Functional

Code

public function getCustomAttachPath() {
  $path = \Drupal::service('file_system')
    ->realpath($this
    ->getFieldSetting('uri_scheme') . '://');
  $path = str_replace(realpath('./'), '', $path);
  $path = ltrim($path, '/');
  $path = $path . '/custom_file_attach/';
  return $path;
}