You are here

class TestLibraryDiscoveryParser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\TestLibraryDiscoveryParser

Wraps the tested class to mock the external dependencies.

Hierarchy

Expanded class hierarchy of TestLibraryDiscoveryParser

File

core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php, line 541
Contains \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest.

Namespace

Drupal\Tests\Core\Asset
View source
class TestLibraryDiscoveryParser extends LibraryDiscoveryParser {
  protected $paths;
  protected $validUris;
  protected function drupalGetPath($type, $name) {
    return isset($this->paths[$type][$name]) ? $this->paths[$type][$name] : NULL;
  }
  public function setPaths($type, $name, $path) {
    $this->paths[$type][$name] = $path;
  }
  protected function fileValidUri($source) {
    return isset($this->validUris[$source]) ? $this->validUris[$source] : FALSE;
  }
  public function setFileValidUri($source, $valid) {
    $this->validUris[$source] = $valid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryDiscoveryParser::$moduleHandler protected property The module handler.
LibraryDiscoveryParser::$root protected property The app root.
LibraryDiscoveryParser::$themeManager protected property The theme manager.
LibraryDiscoveryParser::applyLibrariesOverride protected function Apply libraries overrides specified for the current active theme.
LibraryDiscoveryParser::buildByExtension public function Parses and builds up all the libraries information of an extension.
LibraryDiscoveryParser::isValidUri protected function Determines if the supplied string is a valid URI.
LibraryDiscoveryParser::parseLibraryInfo protected function Parses a given library file and allows modules and themes to alter it.
LibraryDiscoveryParser::resolveThemeAssetPath protected function Ensures that a full path is returned for an overriding theme asset.
LibraryDiscoveryParser::setOverrideValue protected function Overrides the specified library asset.
LibraryDiscoveryParser::__construct public function Constructs a new LibraryDiscoveryParser instance.
TestLibraryDiscoveryParser::$paths protected property
TestLibraryDiscoveryParser::$validUris protected property
TestLibraryDiscoveryParser::drupalGetPath protected function Wraps drupal_get_path(). Overrides LibraryDiscoveryParser::drupalGetPath
TestLibraryDiscoveryParser::fileValidUri protected function Wraps file_valid_uri(). Overrides LibraryDiscoveryParser::fileValidUri
TestLibraryDiscoveryParser::setFileValidUri public function
TestLibraryDiscoveryParser::setPaths public function