You are here

function file_test_reset in Drupal 8

Same name and namespace in other branches
  1. 7 modules/simpletest/tests/file_test.module \file_test_reset()
  2. 9 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()

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
Test the private file transfer system.
DownloadTest::setUp in core/modules/file/tests/src/Functional/DownloadTest.php
FileManagedTestBase::setUp in core/modules/file/src/Tests/FileManagedTestBase.php
Sets up a Drupal site for running functional and integration tests.
FileManagedTestBase::setUp in core/modules/file/tests/src/Functional/FileManagedTestBase.php

... See full list

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);
}