Version 1
[yaffs-website] / web / core / modules / config / tests / config_test / src / TestInstallStorage.php
diff --git a/web/core/modules/config/tests/config_test/src/TestInstallStorage.php b/web/core/modules/config/tests/config_test/src/TestInstallStorage.php
new file mode 100644 (file)
index 0000000..e3c4918
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\config_test;
+
+use Drupal\Core\Config\InstallStorage;
+use Drupal\Core\Extension\ExtensionDiscovery;
+
+/**
+ * Tests configuration of profiles, modules and themes.
+ *
+ * A test configuration storage to read configuration from all profiles, modules
+ * and themes regardless of installation status or installed profile.
+ */
+class TestInstallStorage extends InstallStorage {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getAllFolders() {
+    if (!isset($this->folders)) {
+      $this->folders = $this->getCoreNames();
+      $listing = new ExtensionDiscovery(\Drupal::root());
+      $listing->setProfileDirectories([]);
+      $this->folders += $this->getComponentNames($listing->scan('profile'));
+      $this->folders += $this->getComponentNames($listing->scan('module'));
+      $this->folders += $this->getComponentNames($listing->scan('theme'));
+    }
+    return $this->folders;
+  }
+
+}