Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / tests / modules / deprecation_test / deprecation_test.module
diff --git a/web/core/modules/system/tests/modules/deprecation_test/deprecation_test.module b/web/core/modules/system/tests/modules/deprecation_test/deprecation_test.module
new file mode 100644 (file)
index 0000000..69217db
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @file
+ * Contains functions for testing calling deprecated functions in tests.
+ */
+
+/**
+ * A deprecated function.
+ *
+ * @return string
+ *   A known return value of 'known_return_value'.
+ *
+ * @deprecated in Drupal 8.4.x. Might be removed before Drupal 9.0.0. This is
+ *   the deprecation message for deprecated_test_function().
+ */
+function deprecation_test_function() {
+  @trigger_error('This is the deprecation message for deprecation_test_function().', E_USER_DEPRECATED);
+  return 'known_return_value';
+}
+
+/**
+ * Implements hook_deprecated_hook().
+ */
+function deprecation_test_deprecated_hook($arg) {
+  return $arg;
+}
+
+/**
+ * Implements hook_deprecated_alter_alter().
+ */
+function deprecation_test_deprecated_alter_alter(&$data, $context1, $context2) {
+  $data = [$context1, $context2];
+}