class TestLibraryDiscoveryParser

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\TestLibraryDiscoveryParser
  2. 10 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\TestLibraryDiscoveryParser
  3. 11.x 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 670

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

Title Sort descending Modifiers Object type Summary Overriden Title
LibraryDiscoveryParser::$librariesDirectoryFileFinder protected property The libraries directory file finder.
LibraryDiscoveryParser::$moduleHandler protected property The module handler.
LibraryDiscoveryParser::$root protected property The app root.
LibraryDiscoveryParser::$streamWrapperManager protected property The stream wrapper manager.
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::validateCssLibrary public static function Validates CSS library structure.
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 \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::isValidUri(). Overrides LibraryDiscoveryParser::fileValidUri
TestLibraryDiscoveryParser::setFileValidUri public function
TestLibraryDiscoveryParser::setPaths public function

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