DummyStreamWrapper.php in Drupal 10
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 testing.');
}
public function getDirectoryPath() {
return \Drupal::getContainer()
->getParameter('site.path') . '/files';
}
public function getInternalUri() {
return '/dummy/example.txt';
}
public function getExternalUrl() {
return '/dummy/example.txt';
}
}