Issue #3223267 by alexpott, daffie: Remove some calls to drupal_flush_all_caches() in tests

merge-requests/937/head
catch 2021-07-16 08:47:59 +01:00
parent d6e4a29961
commit 8abf81e7e9
9 changed files with 9 additions and 9 deletions

View File

@ -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.");
}

View File

@ -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.

View File

@ -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();
}
/**

View File

@ -191,7 +191,7 @@ abstract class JsonApiFunctionalTestBase extends BrowserTestBase {
'administer taxonomy',
]);
drupal_flush_all_caches();
\Drupal::service('router.builder')->rebuild();
}
/**

View File

@ -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());

View File

@ -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();
}
/**

View File

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

View File

@ -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([]);

View File

@ -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',