Version 1
[yaffs-website] / web / core / modules / config / tests / config_test / src / ConfigTestStorage.php
diff --git a/web/core/modules/config/tests/config_test/src/ConfigTestStorage.php b/web/core/modules/config/tests/config_test/src/ConfigTestStorage.php
new file mode 100644 (file)
index 0000000..e705715
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\config_test;
+
+use Drupal\Core\Config\Entity\ConfigEntityStorage;
+use Drupal\Core\Config\Config;
+
+/**
+ * @todo.
+ */
+class ConfigTestStorage extends ConfigEntityStorage {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function importCreate($name, Config $new_config, Config $old_config) {
+    // Set a global value we can check in test code.
+    $GLOBALS['hook_config_import'] = __METHOD__;
+
+    return parent::importCreate($name, $new_config, $old_config);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function importUpdate($name, Config $new_config, Config $old_config) {
+    // Set a global value we can check in test code.
+    $GLOBALS['hook_config_import'] = __METHOD__;
+
+    return parent::importUpdate($name, $new_config, $old_config);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function importDelete($name, Config $new_config, Config $old_config) {
+    // Set a global value we can check in test code.
+    $GLOBALS['hook_config_import'] = __METHOD__;
+
+    return parent::importDelete($name, $new_config, $old_config);
+  }
+
+}