class TestExtension

Same name in this branch
  1. 9 core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php \Drupal\twig_extension_test\TwigExtension\TestExtension
Same name in other branches
  1. 8.9.x core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php \Drupal\twig_extension_test\TwigExtension\TestExtension
  2. 8.9.x core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php \Drupal\Tests\Core\Extension\TestExtension
  3. 10 core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php \Drupal\twig_extension_test\TwigExtension\TestExtension
  4. 10 core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php \Drupal\Tests\Core\Extension\TestExtension
  5. 11.x core/modules/system/tests/modules/twig_extension_test/src/TwigExtension/TestExtension.php \Drupal\twig_extension_test\TwigExtension\TestExtension
  6. 11.x core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php \Drupal\Tests\Core\Extension\TestExtension

Hierarchy

  • class \Drupal\Core\Extension\ExtensionList
    • class \Drupal\Tests\Core\Extension\TestExtension extends \Drupal\Core\Extension\ExtensionList

Expanded class hierarchy of TestExtension

File

core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php, line 322

Namespace

Drupal\Tests\Core\Extension
View source
class TestExtension extends ExtensionList {
    
    /**
     * @var string[]
     */
    protected $installedExtensions = [];
    
    /**
     * @var \Drupal\Core\Extension\ExtensionDiscovery|null
     */
    protected $extensionDiscovery;
    
    /**
     * @param \Drupal\Core\Extension\ExtensionDiscovery $extension_discovery
     *   The extension discovery class.
     */
    public function setExtensionDiscovery(ExtensionDiscovery $extension_discovery) {
        $this->extensionDiscovery = $extension_discovery;
    }
    public function setInstalledExtensions(array $extension_names) {
        $this->installedExtensions = $extension_names;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getInstalledExtensionNames() {
        return $this->installedExtensions;
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getExtensionDiscovery() {
        return $this->extensionDiscovery ?: parent::getExtensionDiscovery();
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ExtensionList::$addedPathNames protected property A list of extension folder names directly added in code (not discovered).
ExtensionList::$cache protected property The cache.
ExtensionList::$defaults protected property Default values to be merged into *.info.yml file arrays. 4
ExtensionList::$extensionInfo protected property Static caching for extension info.
ExtensionList::$extensions protected property The cached extensions.
ExtensionList::$infoParser protected property The info parser.
ExtensionList::$installProfile protected property The install profile used by the site.
ExtensionList::$moduleHandler protected property The module handler.
ExtensionList::$pathNames protected property A list of extension folder names keyed by extension name.
ExtensionList::$root protected property The app root.
ExtensionList::$state protected property The state store.
ExtensionList::$type protected property The type of the extension: "module", "theme" or "profile".
ExtensionList::checkIncompatibility public function Tests the compatibility of an extension.
ExtensionList::createExtensionInfo protected function Creates the info value for an extension object. 1
ExtensionList::doList protected function Builds the list of extensions. 2
ExtensionList::doScanExtensions protected function Scans the available extensions. 1
ExtensionList::exists public function Determines if an extension exists in the filesystem.
ExtensionList::get public function Returns a single extension.
ExtensionList::getAllAvailableInfo public function Returns an array of info files information of available extensions.
ExtensionList::getAllInstalledInfo public function Returns an array of info files information of installed extensions.
ExtensionList::getExtensionInfo public function Returns information about a specified extension.
ExtensionList::getInfoCacheId protected function Returns the extension info cache ID.
ExtensionList::getList public function Returns all available extensions.
ExtensionList::getListCacheId protected function Returns the extension list cache ID.
ExtensionList::getName public function Returns the human-readable name of the extension.
ExtensionList::getPath public function Gets the path to an extension of a specific type (module, theme, etc.).
ExtensionList::getPathname public function Gets the info file path for an extension.
ExtensionList::getPathnames public function Returns a list of extension file paths keyed by machine name.
ExtensionList::getPathnamesCacheId protected function Returns the extension filenames cache ID.
ExtensionList::recalculateInfo protected function Generates the information from .info.yml files for extensions of this type.
ExtensionList::recalculatePathnames protected function Generates a sorted list of .info.yml file locations for all extensions.
ExtensionList::reset public function Resets the stored extension list. 1
ExtensionList::setPathname public function Sets the pathname for an extension.
ExtensionList::sortByName public static function Array sorting callback; sorts extensions by their name.
ExtensionList::__construct public function Constructs a new instance. 2
TestExtension::$extensionDiscovery protected property
TestExtension::$installedExtensions protected property
TestExtension::getExtensionDiscovery protected function Returns the extension discovery. Overrides ExtensionList::getExtensionDiscovery
TestExtension::getInstalledExtensionNames protected function Returns a list of machine names of installed extensions. Overrides ExtensionList::getInstalledExtensionNames
TestExtension::setExtensionDiscovery public function
TestExtension::setInstalledExtensions public function

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