DrupalDummyStreamWrapper

Helper class for testing the stream wrapper registry.

Dummy stream wrapper implementation (dummy://).

Hierarchy

Functions & methods

NameDescription
DrupalDummyStreamWrapper::getDirectoryPathGets the path that the wrapper is responsible for. @TODO: Review this method name in D8 per http://drupal.org/node/701358 Overrides DrupalLocalStreamWrapper::getDirectoryPath
DrupalDummyStreamWrapper::getExternalUrlOverride getExternalUrl(). Overrides DrupalStreamWrapperInterface::getExternalUrl
DrupalDummyStreamWrapper::getInternalUriOverride getInternalUri().
DrupalLocalStreamWrapper::chmodBase implementation of chmod(). Overrides DrupalStreamWrapperInterface::chmod
DrupalLocalStreamWrapper::dirnameGets the name of the directory from a given path. Overrides DrupalStreamWrapperInterface::dirname
DrupalLocalStreamWrapper::dir_closedirSupport for closedir().
DrupalLocalStreamWrapper::dir_opendirSupport for opendir().
DrupalLocalStreamWrapper::dir_readdirSupport for readdir().
DrupalLocalStreamWrapper::dir_rewinddirSupport for rewinddir().
DrupalLocalStreamWrapper::getLocalPathReturn the local filesystem path.
DrupalLocalStreamWrapper::getMimeTypeBase implementation of getMimeType(). Overrides DrupalStreamWrapperInterface::getMimeType
DrupalLocalStreamWrapper::getTargetReturns the local writable target of the resource within the stream.
DrupalLocalStreamWrapper::getUriBase implementation of getUri(). Overrides DrupalStreamWrapperInterface::getUri
DrupalLocalStreamWrapper::mkdirSupport for mkdir().
DrupalLocalStreamWrapper::realpathBase implementation of realpath(). Overrides DrupalStreamWrapperInterface::realpath
DrupalLocalStreamWrapper::renameSupport for rename().
DrupalLocalStreamWrapper::rmdirSupport for rmdir().
DrupalLocalStreamWrapper::setUriBase implementation of setUri(). Overrides DrupalStreamWrapperInterface::setUri
DrupalLocalStreamWrapper::stream_closeSupport for fclose().
DrupalLocalStreamWrapper::stream_eofSupport for feof().
DrupalLocalStreamWrapper::stream_flushSupport for fflush().
DrupalLocalStreamWrapper::stream_lockSupport for flock().
DrupalLocalStreamWrapper::stream_openSupport for fopen(), file_get_contents(), file_put_contents() etc.
DrupalLocalStreamWrapper::stream_readSupport for fread(), file_get_contents() etc.
DrupalLocalStreamWrapper::stream_seekSupport for fseek().
DrupalLocalStreamWrapper::stream_statSupport for fstat().
DrupalLocalStreamWrapper::stream_tellSupport for ftell().
DrupalLocalStreamWrapper::stream_writeSupport for fwrite(), file_put_contents() etc.
DrupalLocalStreamWrapper::unlinkSupport for unlink().
DrupalLocalStreamWrapper::url_statSupport for stat().

Properties

NameDescription
DrupalLocalStreamWrapper::$contextStream context resource.
DrupalLocalStreamWrapper::$handleA generic resource handle.
DrupalLocalStreamWrapper::$uriInstance URI (stream).

drupal/modules/simpletest/tests/file_test.module, line 422

View code
<?php
class DrupalDummyStreamWrapper extends DrupalLocalStreamWrapper {
  function getDirectoryPath() {
    return variable_get('stream_public_path', 'sites/default/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';
  }
}
?>