function file_test_get_calls

Same name in other branches
  1. 7.x modules/simpletest/tests/file_test.module \file_test_get_calls()
  2. 9 core/modules/file/tests/file_test/file_test.module \file_test_get_calls()
  3. 10 core/modules/file/tests/file_test/file_test.module \file_test_get_calls()
  4. 11.x core/modules/file/tests/file_test/file_test.module \file_test_get_calls()

Get the arguments passed to invocation of a given hook since file_test_reset() was last called.

Parameters

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

Return value

array Array of the parameters passed to each call.

See also

_file_test_log_call()

file_test_reset()

3 calls to file_test_get_calls()
FileManagedTestBase::assertFileHookCalled in core/modules/file/src/Tests/FileManagedTestBase.php
Assert that a hook_file_* hook was called a certain number of times.
FileManagedTestBase::assertFileHookCalled in core/modules/file/tests/src/Functional/FileManagedTestBase.php
Assert that a hook_file_* hook was called a certain number of times.
FileManagedUnitTestBase::assertFileHookCalled in core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
Assert that a hook_file_* hook was called a certain number of times.

File

core/modules/file/tests/file_test/file_test.module, line 58

Code

function file_test_get_calls($op) {
    $results = \Drupal::state()->get('file_test.results') ?: [];
    return $results[$op];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.