You are here

class TestLibraryDiscoveryParser in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php \Drupal\Tests\Core\Asset\TestLibraryDiscoveryParser
  2. 9 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 849
Contains \Drupal\Tests\Core\Asset\LibraryDiscoveryParserTest.

Namespace

Drupal\Tests\Core\Asset
View source
class TestLibraryDiscoveryParser extends LibraryDiscoveryParser {
  protected $validUris;
  protected function fileValidUri($source) {
    return $this->validUris[$source] ?? FALSE;
  }
  public function setFileValidUri($source, $valid) {
    $this->validUris[$source] = $valid;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryDiscoveryParser::$extensionPathResolver protected property The extension path resolver.
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::$validUris protected property
TestLibraryDiscoveryParser::fileValidUri protected function
TestLibraryDiscoveryParser::setFileValidUri public function