Commit 4d7c3c70 authored by catch's avatar catch
Browse files

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

(cherry picked from commit 8abf81e7)
parent 647ad667
......@@ -173,7 +173,7 @@ public function testLoading() {
$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.");
}
......
......@@ -218,7 +218,7 @@ public function testOffCanvasStyles() {
$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.
......
......@@ -83,7 +83,7 @@ public function setUp(): void {
'field_internal' => $this->internalEntity->id(),
]);
$this->referencingEntity->save();
drupal_flush_all_caches();
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -191,7 +191,7 @@ protected function setUp() {
'administer taxonomy',
]);
drupal_flush_all_caches();
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -34,7 +34,7 @@ public function testLanguageConfigFactoryOverride() {
// 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());
......
......@@ -37,7 +37,7 @@ protected function setUp(): void {
// 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();
}
/**
......
......@@ -99,7 +99,7 @@ public function testChanges() {
// @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());
}
......
......@@ -25,7 +25,7 @@ public function testMultipleKeysCache($translatable) {
'key_1' => 'test_field',
'key_2' => 'test_field',
]);
drupal_flush_all_caches();
$this->installEntitySchema('entity_test');
$entity = EntityTest::create([]);
......
......@@ -58,7 +58,7 @@ public function testRecursiveViolationPropagation() {
->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',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment