Version 1
[yaffs-website] / web / core / modules / system / tests / modules / update_test_1 / update_test_1.install
diff --git a/web/core/modules/system/tests/modules/update_test_1/update_test_1.install b/web/core/modules/system/tests/modules/update_test_1/update_test_1.install
new file mode 100644 (file)
index 0000000..1d632c7
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the update_test_1 module.
+ */
+
+/**
+ * Implements hook_update_dependencies().
+ *
+ * @see update_test_2_update_dependencies()
+ */
+function update_test_1_update_dependencies() {
+  \Drupal::state()->set('update_test_1_update_dependencies_run', TRUE);
+  // These dependencies are used in combination with those declared in
+  // update_test_2_update_dependencies() for the sole purpose of testing that
+  // the results of hook_update_dependencies() are collected correctly and have
+  // the correct array structure. Therefore, we use updates from the
+  // update_test_0 module (which will be installed first) that they will not
+  // get in the way of other tests.
+  $dependencies['update_test_0'][8001] = [
+    // Compare to update_test_2_update_dependencies(), where the same
+    // update_test_0 module update function is forced to depend on an update
+    // function from a different module. This allows us to test that both
+    // dependencies are correctly recorded.
+    'update_test_1' => 8001,
+  ];
+  $dependencies['update_test_0'][8002] = [
+    // Compare to update_test_2_update_dependencies(), where the same
+    // update_test_0 module update function is forced to depend on a
+    // different update function within the same module. This allows us to
+    // test that only the dependency on the higher-numbered update function
+    // is recorded.
+    'update_test_1' => 8003,
+  ];
+  return $dependencies;
+}
+
+/**
+ * Dummy update_test_1 update 8001.
+ */
+function update_test_1_update_8001() {
+}
+
+/**
+ * Dummy update_test_1 update 8002.
+ */
+function update_test_1_update_8002() {
+}
+
+/**
+ * Dummy update_test_1 update 8003.
+ */
+function update_test_1_update_8003() {
+}