You are here

function drupal_static_reset in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/bootstrap.inc \drupal_static_reset()
  2. 7 includes/bootstrap.inc \drupal_static_reset()
  3. 9 core/includes/bootstrap.inc \drupal_static_reset()

Resets one or all centrally stored static variable(s).

Parameters

$name: Name of the static variable to reset. Omit to reset all variables. Resetting all variables should only be used, for example, for running unit tests with a clean environment.

20 calls to drupal_static_reset()
drupal_flush_all_caches in core/includes/common.inc
Rebuilds the container, flushes all persistent caches, resets all variables, and rebuilds all data structures.
FilterAPITest::testDependencyRemoval in core/modules/filter/tests/src/Kernel/FilterAPITest.php
Tests that filter format dependency removal works.
filter_formats_reset in core/modules/filter/filter.module
Resets the text format caches.
FunctionalTestSetupTrait::prepareEnvironment in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Prepares the current environment for running the test.
KernelTestBase::tearDown in core/tests/Drupal/KernelTests/KernelTestBase.php

... See full list

1 string reference to 'drupal_static_reset'
KernelTestBase::tearDown in core/tests/Drupal/KernelTests/KernelTestBase.php

File

core/includes/bootstrap.inc, line 472
Functions that need to be loaded on every Drupal request.

Code

function drupal_static_reset($name = NULL) {
  drupal_static($name, NULL, TRUE);
}