diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index 81d8d82..f52c66c 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -332,6 +332,9 @@ function editForumVocabulary() { $this->assertResponse(200); $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $edit['name'])), 'Vocabulary was edited'); + // Reset cache. + \Drupal::entityManager()->getStorageController('taxonomy_vocabulary')->resetCache(); + // Grab the newly edited vocabulary. $current_vocabulary = entity_load('taxonomy_vocabulary', $vid); diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php index 698b1bb..88bcf2b 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php @@ -241,6 +241,9 @@ function testStyle() { // Delete the style. $this->drupalPostForm($style_path . '/delete', array(), t('Delete')); + // Reset cache. + \Drupal::entityManager()->getStorageController('image_style')->resetCache(); + // Confirm the style directory has been removed. $directory = file_default_scheme() . '://styles/' . $style_name; $this->assertFalse(is_dir($directory), format_string('Image style %style directory removed on style deletion.', array('%style' => $style->label()))); diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php index a616a4d..298b09f 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDefaultImagesTest.php @@ -222,6 +222,9 @@ public function testDefaultImages() { array('@fid' => $default_images['instance_new']->id()) ) ); + + // Reset cache. + \Drupal::entityManager()->getStorageController('entity_display')->resetCache(); // Reload the nodes. $article_built = node_view($article = node_load($article->id(), TRUE)); @@ -258,6 +261,9 @@ public function testDefaultImages() { 'Updated article image field instance default has been successfully removed.' ); + // Reset cache. + \Drupal::entityManager()->getStorageController('entity_display')->resetCache(); + // Reload the nodes. $article_built = node_view($article = node_load($article->id(), TRUE)); $page_built = node_view($page = node_load($page->id(), TRUE)); diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php index f4f9e53..0055623 100644 --- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php +++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php @@ -178,6 +178,10 @@ function deleteCustomMenu($menu) { // Delete custom menu. $this->drupalPostForm("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('menu')->resetCache(); + $this->assertResponse(200); $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $label)), 'Custom menu was deleted'); $this->assertFalse(menu_load($menu_name), 'Custom menu was deleted'); diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php index c00cc63..0ff0492 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php @@ -60,6 +60,10 @@ function testUpdateAllowedValues() { // Removed options do not appear. $this->field->settings['allowed_values'] = array(2 => 'Two'); $this->field->save(); + + // Reset cache. + \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); + $entity = entity_create('entity_test', array()); $form = \Drupal::entityManager()->getForm($entity); $this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist'); @@ -69,6 +73,10 @@ function testUpdateAllowedValues() { // Completely new options appear. $this->field->settings['allowed_values'] = array(10 => 'Update', 20 => 'Twenty'); $this->field->save(); + + // Reset cache. + \Drupal::entityManager()->getStorageController('entity_form_display')->resetCache(); + // The entity holds an outdated field object with the old allowed values // setting, so we need to reintialize the entity object. $entity = entity_create('entity_test', array()); diff --git a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php index 63ebf66..0a2de31 100644 --- a/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php +++ b/core/modules/path/lib/Drupal/path/Tests/PathLanguageTest.php @@ -69,6 +69,10 @@ function setUp() { // Ensure configuration changes are picked up in the host environment. Field::fieldInfo()->flush(); + + // Reset cache. + \Drupal::entityManager()->getStorageController('node')->resetCache(); + $field = Field::fieldInfo()->getField('node', 'body'); $this->assertTrue($field->isFieldTranslatable(), 'Node body is translatable.'); } @@ -85,6 +89,9 @@ function testAliasTranslation() { $edit['path[alias]'] = $english_alias; $this->drupalPostForm('node/' . $english_node->id() . '/edit', $edit, t('Save')); + // Reset cache. + \Drupal::entityManager()->getStorageController('node')->resetCache(); + // Confirm that the alias works. $this->drupalGet($english_alias); $this->assertText($english_node->body->value, 'Alias works.'); @@ -105,6 +112,10 @@ function testAliasTranslation() { // Languages are cached on many levels, and we need to clear those caches. drupal_static_reset('language_list'); + + // Reset cache. + \Drupal::entityManager()->getStorageController('node')->resetCache(); + $this->rebuildContainer(); $languages = language_list(); @@ -136,6 +147,9 @@ function testAliasTranslation() { $edit = array('preferred_langcode' => 'fr'); $this->drupalPostForm("user/" . $this->web_user->id() . "/edit", $edit, t('Save')); + // Reset cache. + \Drupal::entityManager()->getStorageController('node')->resetCache(); + // Check that the English alias works. In this situation French is the // current UI and content language, while URL language is English (since we // do not have a path prefix we fall back to the site's default language). diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php index bd2d194..3b49ca1 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php @@ -60,6 +60,10 @@ function testShortcutLinkAdd() { ); $this->drupalPostForm('admin/config/user-interface/shortcut/manage/' . $set->id() . '/add-link', $form_data, t('Save')); $this->assertResponse(200); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $saved_set = shortcut_set_load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'link_path'); $test_path = empty($test['path']) ? '' : $test['path']; @@ -93,6 +97,10 @@ function testShortcutLinkRename() { $link = reset($set->links); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $link->mlid, array('shortcut_link[link_title]' => $new_link_name, 'shortcut_link[link_path]' => $link->link_path), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $saved_set = shortcut_set_load($set->id()); $titles = $this->getShortcutInformation($saved_set, 'link_title'); $this->assertTrue(in_array($new_link_name, $titles), 'Shortcut renamed: ' . $new_link_name); @@ -110,6 +118,10 @@ function testShortcutLinkChangePath() { $link = reset($set->links); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $link->mlid, array('shortcut_link[link_title]' => $link->link_title, 'shortcut_link[link_path]' => $new_link_path), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $saved_set = shortcut_set_load($set->id()); $paths = $this->getShortcutInformation($saved_set, 'link_path'); $this->assertTrue(in_array($new_link_path, $paths), 'Shortcut path changed: ' . $new_link_path); @@ -124,6 +136,10 @@ function testShortcutLinkDelete() { $link = reset($set->links); $this->drupalPostForm('admin/config/user-interface/shortcut/link/' . $link->mlid . '/delete', array(), 'Delete'); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $saved_set = shortcut_set_load($set->id()); $mlids = $this->getShortcutInformation($saved_set, 'mlid'); $this->assertFalse(in_array($link->mlid, $mlids), 'Successfully deleted a shortcut.'); diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php index 470227a..7eb567b 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php @@ -31,6 +31,10 @@ function testShortcutSetAdd() { 'id' => strtolower($this->randomName()), ); $this->drupalPostForm(NULL, $edit, t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $new_set = $this->container->get('entity.manager')->getStorageController('shortcut_set')->load($edit['id']); $this->assertIdentical($new_set->id(), $edit['id'], 'Successfully created a shortcut set.'); $this->drupalGet('user/' . $this->admin_user->id() . '/shortcuts'); @@ -115,6 +119,10 @@ function testShortcutSetRename() { $this->drupalGet('admin/config/user-interface/shortcut'); $this->clickLink(t('Edit menu')); $this->drupalPostForm(NULL, array('label' => $new_label), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('shortcut_set')->resetCache(); + $set = shortcut_set_load($set->id()); $this->assertTrue($set->label() == $new_label, 'Shortcut set has been successfully renamed.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php index 9c472ff..43d447c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilterFormatUpgradePathTest.php @@ -86,6 +86,10 @@ public function testFilterFormatUpgrade() { $this->assertRaw(t('The %filter filter is missing, and will be removed once this format is saved.', array('%filter' => 'missing_filter'))); $this->drupalPostForm(NULL, array(), t('Save configuration')); filter_formats_reset(); + + // Reset cache. + \Drupal::entityManager()->getStorageController('filter_format')->resetCache(); + $two = entity_load('filter_format', 'format_two'); $this->assertFalse($two->filters()->has('missing_filter')); } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php index 48ce623..1d3ef66 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php @@ -80,6 +80,10 @@ function testAdministratorRole() { // Aggregator depends on file module, enable that as well. $edit['modules[Core][file][enable]'] = TRUE; $this->drupalPostForm('admin/modules', $edit, t('Save configuration')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('user_role')->resetCache(); + $this->assertTrue(user_access('administer news feeds', $this->admin_user), 'The permission was automatically assigned to the administrator role'); } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php index ba2a4b3..c01e910 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRoleAdminTest.php @@ -57,6 +57,10 @@ function testRoleAdministration() { $edit = array('label' => $role_name); $this->drupalPostForm("admin/people/roles/manage/{$role->id()}", $edit, t('Save')); $this->assertRaw(t('Role %label has been updated.', array('%label' => $role_name))); + + // Reset cache. + \Drupal::entityManager()->getStorageController('user_role')->resetCache(); + $new_role = entity_load('user_role', $old_name); $this->assertEqual($new_role->label(), $role_name, 'The role name has been successfully changed.'); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php index f492a13..67daed6 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTest.php @@ -74,6 +74,9 @@ public function testStyle() { $output = drupal_render($output); $this->assertTrue(strpos($output, $random_text) !== FALSE, 'Make sure that the rendering of the row plugin appears in the output of the view.'); + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + // Test without row plugin support. $view = views_get_view('test_view'); $view->setDisplay(); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php index ae17b19..9bafd49 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/CustomBooleanTest.php @@ -101,6 +101,9 @@ public function testCustomOption() { // Save the view. $this->drupalPostForm('admin/structure/views/view/test_view', array(), 'Save'); + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + $view = views_get_view('test_view'); $output = $view->preview(); $output = drupal_render($output); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php index 61e534b..9dbe655 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayAttachmentTest.php @@ -58,6 +58,9 @@ public function testAttachmentUI() { $this->assertEqual($result[0]->attributes()->title, t('Multiple displays')); $this->drupalPostForm(NULL, array(), t('Save')); + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + $view = views_get_view('test_attachment_ui'); $view->initDisplay(); $this->assertEqual(array_keys($view->displayHandlers->get('attachment_1')->getOption('displays')), array('default', 'page_1'), 'The attached displays got saved as expected'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php index 9515b4b..2b222b5 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayExtenderUITest.php @@ -44,6 +44,10 @@ public function testDisplayExtenderUI() { $this->drupalPostForm($display_option_url, array('test_extender_test_option' => $random_text), t('Apply')); $this->assertLink($random_text); $this->drupalPostForm(NULL, array(), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + $view = views_get_view($view->storage->id()); $view->initDisplay(); $this->assertEqual($view->display_handler->getOption('test_extender_test_option'), $random_text, 'Make sure that the display extender option got saved.'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php index 7ff3747..9aab0c8 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/HandlerTest.php @@ -109,6 +109,10 @@ public function testUICRUD() { // Save the view and have a look whether the handler was added as expected. $this->drupalPostForm(NULL, array(), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertTrue(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was added to the view itself.'); @@ -118,6 +122,10 @@ public function testUICRUD() { $this->assertNoLinkByHref($edit_handler_url, 0, 'The handler edit link does not appears in the UI after removing.'); $this->drupalPostForm(NULL, array(), t('Save')); + + // Reset cache. + \Drupal::entityManager()->getStorageController('view')->resetCache(); + $view = $this->container->get('entity.manager')->getStorageController('view')->load('test_view_empty'); $display = $view->getDisplay('default'); $this->assertFalse(isset($display['display_options'][$type_info['plural']][$id]), 'Ensure the field was removed from the view itself.');