diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index 9a4680c..5063d00 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -216,6 +216,7 @@ public function testViewsBlockForm() { $edit['settings[override][items_per_page]'] = 5; $this->drupalPostForm('admin/structure/block/manage/views_block__test_view_block_block_1_4', $edit, t('Save block')); + $storage->resetCache(); $block = $storage->load('views_block__test_view_block_block_1_4'); $config = $block->getPlugin()->getConfiguration(); diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php index f984160..5e603c5 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php @@ -139,6 +139,7 @@ function testAdmin() { ); $this->drupalPostForm(NULL, $edit, t('Save configuration')); $expected_settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.callout|Callout\n\n"; + \Drupal::entityManager()->getStorageController('editor')->resetCache(); $editor = entity_load('editor', 'filtered_html'); $this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.'); $this->assertIdentical($expected_settings, $editor->settings, 'The Editor config entity has the correct settings.'); @@ -156,6 +157,7 @@ function testAdmin() { 'editor[settings][toolbar][button_groups]' => json_encode($expected_settings['toolbar']['rows']), ); $this->drupalPostForm(NULL, $edit, t('Save configuration')); + \Drupal::entityManager()->getStorageController('editor')->resetCache(); $editor = entity_load('editor', 'filtered_html'); $this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.'); $this->assertIdentical($expected_settings, $editor->settings, 'The Editor config entity has the correct settings.'); @@ -181,6 +183,7 @@ function testAdmin() { $ultra_llama_mode_checkbox = $this->xpath('//input[@type="checkbox" and @name="editor[settings][plugins][llama_contextual_and_button][ultra_llama_mode]" and @checked="checked"]'); $this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is checked.'); $expected_settings['plugins']['llama_contextual_and_button']['ultra_llama_mode'] = 1; + \Drupal::entityManager()->getStorageController('editor')->resetCache(); $editor = entity_load('editor', 'filtered_html'); $this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.'); $this->assertIdentical($expected_settings, $editor->settings); diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php index 1c69c2e..44a8db0 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php @@ -402,6 +402,7 @@ function deleteCategories() { else { $this->drupalPostForm("admin/structure/contact/manage/$id/delete", array(), t('Delete')); $this->assertRaw(t('Category %label has been deleted.', array('%label' => $category->label()))); + \Drupal::entityManager()->getStorageController('contact_category')->resetCache(); $this->assertFalse(entity_load('contact_category', $id), format_string('Category %category not found', array('%category' => $category->label()))); } } diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php index 5fe5f89..d596c0b 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityDisplayTest.php @@ -217,8 +217,10 @@ public function testRenameDeleteBundle() { $info->old_type = 'article'; $info->type = 'article_rename'; $info->save(); + \Drupal::entityManager()->getStorageController('entity_display')->resetCache(); $old_display = entity_load('entity_display', 'node.article.default'); $this->assertFalse($old_display); + \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); $old_form_display = entity_load('entity_form_display', 'node.article.default'); $this->assertFalse($old_form_display); $new_display = entity_load('entity_display', 'node.article_rename.default'); diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index 5904ebe..bb44af3 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -39,6 +39,11 @@ function field_info_cache_clear() { \Drupal::typedData()->clearCachedDefinitions(); \Drupal::service('plugin.manager.field.field_type')->clearCachedDefinitions(); + // Make sure that instantiated field definition and instance entities are + // cleared. + \Drupal::entityManager()->getStorageController('field_entity')->resetCache(); + \Drupal::entityManager()->getStorageController('field_instance')->resetCache(); + Field::fieldInfo()->flush(); } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php index ca31aae..3cd1639 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php @@ -69,6 +69,7 @@ function testFormatterUI() { // Submit the form and check that the display is updated. $this->drupalPostForm(NULL, array(), t('Save')); + \Drupal::entityManager()->getStorageController('entity_display')->resetCache(); $display = entity_get_display('node', $this->type, 'default'); $display_options = $display->getComponent('field_test'); $current_format = $display_options['type']; @@ -146,6 +147,7 @@ public function testWidgetUI() { // Submit the form and check that the display is updated. $this->drupalPostForm(NULL, array(), t('Save')); + \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); $display = entity_get_form_display('node', $this->type, 'default'); $display_options = $display->getComponent('field_test'); $current_widget = $display_options['type']; @@ -345,6 +347,8 @@ function assertNodeViewNoText(EntityInterface $node, $view_mode, $text, $message function assertNodeViewTextHelper(EntityInterface $node, $view_mode, $text, $message, $not_exists) { // Make sure caches on the tester side are refreshed after changes // submitted on the tested side. + \Drupal::entityManager()->getStorageController('entity_display')->resetCache(); + \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); field_info_cache_clear(); // Save current content so that we can restore it when we're done. diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php index bccc9f3..04d34c2 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterAdminTest.php @@ -178,6 +178,7 @@ function testFilterAdmin() { )); $this->assertTrue(!empty($elements), 'Reorder confirmed in admin interface.'); + \Drupal::entityManager()->getStorageController('filter_format')->resetCache(); $filter_format = entity_load('filter_format', $restricted); foreach ($filter_format->filters() as $filter_name => $filter) { if ($filter_name == $second_filter || $filter_name == $first_filter) {