function file_test_reset

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

Reset/initialize the history of calls to the file_* hooks.

See also

file_test_get_calls()

file_test_reset()

13 calls to file_test_reset()
FileDeleteTest::testInUse in modules/simpletest/tests/file.test
Tries deleting a file that is in use.
FileDownloadTest::setUp in modules/simpletest/tests/file.test
Sets up a Drupal site for running functional and integration tests.
FileDownloadTest::testPrivateFileTransfer in modules/simpletest/tests/file.test
Test the private file transfer system.
FileHookTestCase::setUp in modules/simpletest/tests/file.test
Sets up a Drupal site for running functional and integration tests.
FileLoadTest::testMultiple in modules/simpletest/tests/file.test
This will test loading file data from the database.

... See full list

File

modules/simpletest/tests/file_test.module, line 152

Code

function file_test_reset() {
  // Keep track of calls to these hooks
  $results = array(
    'load' => array(),
    'validate' => array(),
    'download' => array(),
    'insert' => array(),
    'update' => array(),
    'copy' => array(),
    'move' => array(),
    'delete' => array(),
  );
  variable_set('file_test_results', $results);
  // These hooks will return these values, see file_test_set_return().
  $return = array(
    'validate' => array(),
    'download' => NULL,
  );
  variable_set('file_test_return', $return);
}

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