function _file_test_get_return

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

Load the appropriate return value.

Parameters

string $op: One of the hook_file_[validate,download] operations.

Return value

mixed Value set by file_test_set_return().

See also

file_test_set_return()

file_test_reset()

1 call to _file_test_get_return()
file_test_file_download in core/modules/file/tests/file_test/file_test.module
Implements hook_file_download().

File

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

Code

function _file_test_get_return($op) {
    $return = \Drupal::state()->get('file_test.return', [
        $op => NULL,
    ]);
    return $return[$op];
}

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