function file_test_set_return in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/file/tests/file_test/file_test.module \file_test_set_return()
Assign a return value for a given operation.
Parameters
string $op: One of the hook_file_[validate,download] operations.
mixed $value: Value for the hook to return.
See also
3 calls to file_test_set_return()
- DownloadTest::checkUrl in core/
modules/ file/ src/ Tests/ DownloadTest.php - Download a file from the URL generated by file_create_url().
- DownloadTest::doPrivateFileTransferTest in core/
modules/ file/ src/ Tests/ DownloadTest.php - Test the private file transfer system.
- ValidateTest::testCallerValidation in core/
modules/ file/ src/ Tests/ ValidateTest.php - Test that the validators passed into are checked.
File
- core/
modules/ file/ tests/ file_test/ file_test.module, line 123 - Helper module for the file tests.
Code
function file_test_set_return($op, $value) {
$return = \Drupal::state()
->get('file_test.return') ?: array();
$return[$op] = $value;
\Drupal::state()
->set('file_test.return', $return);
}