DummyStreamWrapper.php in Drupal 9        
                          
                  
                        
  
  
  
  
File
  core/modules/file/tests/file_test/src/StreamWrapper/DummyStreamWrapper.php
  
    View source  
  <?php
namespace Drupal\file_test\StreamWrapper;
use Drupal\Core\StreamWrapper\LocalStream;
class DummyStreamWrapper extends LocalStream {
  
  public function getName() {
    return t('Dummy files');
  }
  
  public function getDescription() {
    return t('Dummy wrapper for simpletest.');
  }
  public function getDirectoryPath() {
    return \Drupal::getContainer()
      ->getParameter('site.path') . '/files';
  }
  
  public function getInternalUri() {
    return '/dummy/example.txt';
  }
  
  public function getExternalUrl() {
    return '/dummy/example.txt';
  }
}