You are here

function drupal_static_reset in Drupal 8

Same name and namespace in other branches
  1. 7 includes/bootstrap.inc \drupal_static_reset()
  2. 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.

29 calls to drupal_static_reset()
drupal_flush_all_caches in core/includes/common.inc
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.
ImageEffectsTest::testImageEffectsCaching in core/modules/image/tests/src/Functional/ImageEffectsTest.php
Test image effect caching.

... 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 1004
Functions that need to be loaded on every Drupal request.

Code

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