Version 1
[yaffs-website] / web / core / modules / system / src / PhpStorage / MockPhpStorage.php
diff --git a/web/core/modules/system/src/PhpStorage/MockPhpStorage.php b/web/core/modules/system/src/PhpStorage/MockPhpStorage.php
new file mode 100644 (file)
index 0000000..faac373
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+
+namespace Drupal\system\PhpStorage;
+
+/**
+ * Mock PHP storage class used for testing.
+ */
+class MockPhpStorage {
+
+  /**
+   * The storage configuration.
+   *
+   * @var array
+   */
+  protected $configuration;
+
+  /**
+   * Constructs a MockPhpStorage object.
+   *
+   * @param array $configuration
+   */
+  public function __construct(array $configuration) {
+    $this->configuration = $configuration;
+  }
+
+  /**
+   * Gets the configuration data.
+   */
+  public function getConfiguration() {
+    return $this->configuration;
+  }
+
+  /**
+   * Gets a single configuration key.
+   */
+  public function getConfigurationValue($key) {
+    return isset($this->configuration[$key]) ? $this->configuration[$key] : NULL;
+  }
+
+}