class ImageTestDummyStreamWrapper

Same name and namespace in other branches
  1. main core/modules/image/tests/modules/image_module_test/src/StreamWrapper/ImageTestDummyStreamWrapper.php \Drupal\image_module_test\StreamWrapper\ImageTestDummyStreamWrapper

A non-public, non-private local stream wrapper for image style access tests.

Mimics a contributed stream wrapper (e.g. s3fs) so tests can cover the case where image style derivatives are served from a scheme that is neither core 'public' nor core 'private'.

Hierarchy

Expanded class hierarchy of ImageTestDummyStreamWrapper

1 string reference to 'ImageTestDummyStreamWrapper'
image_module_test.services.yml in core/modules/image/tests/modules/image_module_test/image_module_test.services.yml
core/modules/image/tests/modules/image_module_test/image_module_test.services.yml
1 service uses ImageTestDummyStreamWrapper
stream_wrapper.image_test_private in core/modules/image/tests/modules/image_module_test/image_module_test.services.yml
Drupal\image_module_test\StreamWrapper\ImageTestDummyStreamWrapper

File

core/modules/image/tests/modules/image_module_test/src/StreamWrapper/ImageTestDummyStreamWrapper.php, line 16

Namespace

Drupal\image_module_test\StreamWrapper
View source
class ImageTestDummyStreamWrapper extends LocalStream {
  
  /**
   * {@inheritdoc}
   */
  public function getName() : string {
    return 'Image test private files';
  }
  
  /**
   * {@inheritdoc}
   */
  public function getDescription() : string {
    return 'Image module test wrapper for non-public access checks.';
  }
  
  /**
   * {@inheritdoc}
   */
  public function getDirectoryPath() : string {
    return \Drupal::getContainer()->getParameter('site.path') . '/files';
  }
  
  /**
   * {@inheritdoc}
   */
  public function getExternalUrl() : string {
    return '';
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.