function file_test_reset in Drupal 9
Same name and namespace in other branches
- 8 core/modules/file/tests/file_test/file_test.module \file_test_reset()
- 7 modules/simpletest/tests/file_test.module \file_test_reset()
Reset/initialize the history of calls to the file_* hooks.
See also
21 calls to file_test_reset()
- DeleteTest::testInUse in core/
modules/ file/ tests/ src/ Kernel/ DeleteTest.php - Tries deleting a file that is in use.
- DownloadTest::doPrivateFileTransferTest in core/
modules/ file/ tests/ src/ Functional/ DownloadTest.php - Tests the private file transfer system.
- DownloadTest::setUp in core/
modules/ file/ tests/ src/ Functional/ DownloadTest.php - FileManagedTestBase::setUp in core/
modules/ file/ tests/ src/ Functional/ FileManagedTestBase.php - FileManagedUnitTestBase::setUp in core/
modules/ file/ tests/ src/ Kernel/ FileManagedUnitTestBase.php
File
- core/
modules/ file/ tests/ file_test/ file_test.module, line 22 - Helper module for the file tests.
Code
function file_test_reset() {
// Keep track of calls to these hooks
$results = [
'load' => [],
'validate' => [],
'download' => [],
'insert' => [],
'update' => [],
'copy' => [],
'move' => [],
'delete' => [],
];
\Drupal::state()
->set('file_test.results', $results);
// These hooks will return these values, see file_test_set_return().
$return = [
'validate' => [],
'download' => NULL,
];
\Drupal::state()
->set('file_test.return', $return);
}