Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 10 |
| DummyReadOnlyStreamWrapper | |
0.00% |
0 / 1 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 10 |
| getName | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getDescription | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getDirectoryPath | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getInternalUri | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getExternalUrl | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\file_test\StreamWrapper\DummyReadOnlyStreamWrapper. | |
| */ | |
| namespace Drupal\file_test\StreamWrapper; | |
| use Drupal\Core\StreamWrapper\LocalReadOnlyStream; | |
| /** | |
| * Helper class for testing the stream wrapper registry. | |
| * | |
| * Dummy stream wrapper implementation (dummy-readonly://). | |
| */ | |
| class DummyReadOnlyStreamWrapper extends LocalReadOnlyStream { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getName() { | |
| return t('Dummy files (readonly)'); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getDescription() { | |
| return t('Dummy wrapper for simpletest (readonly).'); | |
| } | |
| function getDirectoryPath() { | |
| return \Drupal::service('site.path') . '/files'; | |
| } | |
| /** | |
| * Override getInternalUri(). | |
| * | |
| * Return a dummy path for testing. | |
| */ | |
| function getInternalUri() { | |
| return '/dummy/example.txt'; | |
| } | |
| /** | |
| * Override getExternalUrl(). | |
| * | |
| * Return the HTML URI of a public file. | |
| */ | |
| function getExternalUrl() { | |
| return '/dummy/example.txt'; | |
| } | |
| } |