diff --git a/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php b/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php index cf34e427d8c..fec5083a088 100644 --- a/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/tests/src/Functional/CKEditorLoadingTest.php @@ -173,7 +173,7 @@ class CKEditorLoadingTest extends BrowserTestBase { $this->assertSame($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct before flushing all caches."); // Flush all caches then make sure that $settings['ckeditor']['timestamp'] // still matches. - drupal_flush_all_caches(); + $this->resetAll(); $this->assertSame($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct after flushing all caches."); } diff --git a/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php index 3eddae8b76b..90d60e40eb5 100644 --- a/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php +++ b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @@ -218,7 +218,7 @@ class CKEditorIntegrationTest extends WebDriverTestBase { $old_keys = $this->getSession()->evaluateScript($get_cache_keys); // Flush the caches to ensure the new timestamp is altered into the // drupal.ckeditor library's javascript settings. - drupal_flush_all_caches(); + $this->resetAll(); // Normally flushing caches regenerates the cache busting query string, but // as it's based on the request time, it won't change within this test so // explicitly set it. diff --git a/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php b/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php index 90d9dd5d2d4..032c49698e5 100644 --- a/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php +++ b/core/modules/jsonapi/tests/src/Functional/InternalEntitiesTest.php @@ -83,7 +83,7 @@ class InternalEntitiesTest extends BrowserTestBase { 'field_internal' => $this->internalEntity->id(), ]); $this->referencingEntity->save(); - drupal_flush_all_caches(); + \Drupal::service('router.builder')->rebuild(); } /** diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTestBase.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTestBase.php index 7a123e728ca..832278be1b5 100644 --- a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTestBase.php +++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTestBase.php @@ -191,7 +191,7 @@ abstract class JsonApiFunctionalTestBase extends BrowserTestBase { 'administer taxonomy', ]); - drupal_flush_all_caches(); + \Drupal::service('router.builder')->rebuild(); } /** diff --git a/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php b/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php index 722fcbc8add..7079918e7bd 100644 --- a/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php +++ b/core/modules/language/tests/src/Kernel/LanguageConfigFactoryOverrideTest.php @@ -34,7 +34,7 @@ class LanguageConfigFactoryOverrideTest extends KernelTestBase { // Invalidate the container. $this->config('system.site')->set('default_langcode', 'de')->save(); - drupal_flush_all_caches(); + $this->container->get('kernel')->rebuildContainer(); $config_factory_override = \Drupal::service('language.config_factory_override'); $this->assertEquals('de', $config_factory_override->getLanguage()->getId()); diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php index 434511da72a..c7c7b94909b 100644 --- a/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleTranslatedSchemaDefinitionTest.php @@ -37,7 +37,7 @@ class LocaleTranslatedSchemaDefinitionTest extends BrowserTestBase { // Clear all caches so that the base field definition, its cache in the // entity field manager, the t() cache, etc. are all cleared. - drupal_flush_all_caches(); + $this->resetAll(); } /** diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php index eab06c75f61..64b9b87bde7 100644 --- a/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php +++ b/core/modules/system/tests/src/Functional/Theme/ThemeInfoTest.php @@ -99,7 +99,7 @@ class ThemeInfoTest extends BrowserTestBase { // @see theme_test_system_info_alter() $this->state->set('theme_test.modify_info_files', TRUE); - drupal_flush_all_caches(); + $this->resetAll(); $active_theme = $this->themeManager->getActiveTheme(); $this->assertEquals(['classy/base', 'classy/messages', 'core/normalize', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries()); } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php index 79a06c936ff..18eb76267d3 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php @@ -25,7 +25,7 @@ class EntityKeysTest extends EntityKernelTestBase { 'key_1' => 'test_field', 'key_2' => 'test_field', ]); - drupal_flush_all_caches(); + $this->installEntitySchema('entity_test'); $entity = EntityTest::create([]); diff --git a/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php index d43cd7d7a1a..6e5269e7dbd 100644 --- a/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php +++ b/core/tests/Drupal/KernelTests/Core/TypedData/RecursiveContextualValidatorTest.php @@ -58,7 +58,7 @@ class RecursiveContextualValidatorTest extends KernelTestBase { ->setLabel('Required string') ->setRequired(TRUE); $this->container->get('state')->set('entity_test.additional_base_field_definitions', $definitions); - drupal_flush_all_caches(); + $this->installEntitySchema('entity_test'); $child = EntityTest::create([ 'name' => 'test2',