Version 1
[yaffs-website] / web / core / modules / hal / tests / modules / hal_test / hal_test.module
diff --git a/web/core/modules/hal/tests/modules/hal_test/hal_test.module b/web/core/modules/hal/tests/modules/hal_test/hal_test.module
new file mode 100644 (file)
index 0000000..8788eaf
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Contains hook implementations for testing HAL module.
+ */
+
+/**
+ * Implements hook_hal_type_uri_alter().
+ */
+function hal_test_hal_type_uri_alter(&$uri, $context = []) {
+  if (!empty($context['hal_test'])) {
+    $uri = 'hal_test_type';
+  }
+}
+
+/**
+ * Implements hook_hal_relation_uri_alter().
+ */
+function hal_test_hal_relation_uri_alter(&$uri, $context = []) {
+  if (!empty($context['hal_test'])) {
+    $uri = 'hal_test_relation';
+  }
+}
+
+/**
+ * Implements hook_rest_type_uri_alter().
+ *
+ * @deprecated Kept only for BC test coverage, see \Drupal\Tests\hal\Kernel\HalLinkManagerTest::testGetTypeUri().
+ */
+function hal_test_rest_type_uri_alter(&$uri, $context = []) {
+  if (!empty($context['rest_test'])) {
+    $uri = 'rest_test_type';
+  }
+}
+
+/**
+ * Implements hook_rest_relation_uri_alter().
+ *
+ * @deprecated Kept only for BC test coverage, see \Drupal\Tests\hal\Kernel\HalLinkManagerTest::testGetRelationUri().
+ */
+function hal_test_rest_relation_uri_alter(&$uri, $context = []) {
+  if (!empty($context['rest_test'])) {
+    $uri = 'rest_test_relation';
+  }
+}