You are here

function _file_test_log_call in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/tests/file_test/file_test.module \_file_test_log_call()
  2. 7 modules/simpletest/tests/file_test.module \_file_test_log_call()

Store the values passed to a hook invocation.

Parameters

string $op: One of the hook_file_* operations: 'load', 'validate', 'download', 'insert', 'update', 'copy', 'move', 'delete'.

array $args: Values passed to hook.

See also

file_test_get_calls()

file_test_reset()

8 calls to _file_test_log_call()
file_test_file_copy in core/modules/file/tests/file_test/file_test.module
Implements hook_file_copy().
file_test_file_download in core/modules/file/tests/file_test/file_test.module
Implements hook_file_download().
file_test_file_insert in core/modules/file/tests/file_test/file_test.module
Implements hook_ENTITY_TYPE_insert() for file entities.
file_test_file_load in core/modules/file/tests/file_test/file_test.module
Implements hook_ENTITY_TYPE_load() for file entities.
file_test_file_move in core/modules/file/tests/file_test/file_test.module
Implements hook_file_move().

... See full list

File

core/modules/file/tests/file_test/file_test.module, line 87
Helper module for the file tests.

Code

function _file_test_log_call($op, $args) {
  if (\Drupal::state()
    ->get('file_test.count_hook_invocations', TRUE)) {
    $results = \Drupal::state()
      ->get('file_test.results', []);
    $results[$op][] = $args;
    \Drupal::state()
      ->set('file_test.results', $results);
  }
}