jsonapi_test_user.module in Drupal 9
Same filename and directory in other branches
Support module for JSON:API user hooks testing.
File
core/modules/jsonapi/tests/modules/jsonapi_test_user/jsonapi_test_user.moduleView source
<?php
/**
* @file
* Support module for JSON:API user hooks testing.
*/
use Drupal\Core\Session\AccountInterface;
/**
* Implements hook_user_format_name_alter().
*/
function jsonapi_test_user_user_format_name_alter(&$name, AccountInterface $account) {
if ($account
->isAnonymous()) {
$name = 'User ' . $account
->id();
}
}
Functions
Name | Description |
---|---|
jsonapi_test_user_user_format_name_alter | Implements hook_user_format_name_alter(). |