You are here

function _entity_test_record_hooks in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/entity_test/entity_test.module \_entity_test_record_hooks()

Helper function to be used to record hook invocations.

Parameters

string $hook: The hook name.

mixed $data: Arbitrary data associated with the hook invocation.

20 calls to _entity_test_record_hooks()
entity_test_entity_revision_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_entity_revision_create().
entity_test_entity_test_mulrev_changed_translation_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_create() for 'entity_test_mulrev_changed'.
entity_test_entity_test_mulrev_changed_translation_delete in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_delete().
entity_test_entity_test_mulrev_changed_translation_insert in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_translation_insert() for 'entity_test_mulrev'.
entity_test_entity_test_mulrev_revision_create in core/modules/system/tests/modules/entity_test/entity_test.module
Implements hook_ENTITY_TYPE_revision_create() for 'entity_test_mulrev'.

... See full list

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 767
Test module for the entity API providing several entity types for testing.

Code

function _entity_test_record_hooks($hook, $data) {
  $state = \Drupal::state();
  $key = 'entity_test.hooks';
  $hooks = $state
    ->get($key);
  $hooks[$hook] = $data;
  $state
    ->set($key, $hooks);
}