You are here

hal_test.module in Drupal 8

Same filename and directory in other branches
  1. 9 core/modules/hal/tests/modules/hal_test/hal_test.module

Contains hook implementations for testing HAL module.

File

core/modules/hal/tests/modules/hal_test/hal_test.module
View source
<?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().
 *
 * @see https://www.drupal.org/node/2830467
 */
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().
 *
 * @see https://www.drupal.org/node/2830467
 */
function hal_test_rest_relation_uri_alter(&$uri, $context = []) {
  if (!empty($context['rest_test'])) {
    $uri = 'rest_test_relation';
  }
}