diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php index 805a1cf..9844219 100644 --- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php @@ -111,6 +111,7 @@ public function testCustomBlock() { $custom_block['region'] = $this->regions[0]; $this->drupalPost("admin/structure/block/list/block_plugin_ui:$default_theme/add/custom_blocks", $custom_block, t('Save block')); $plugin_id = "plugin.core.block.$default_theme.$info"; + $this->container->get('plugin.manager.block')->clearCachedDefinitions(); $block = $this->container->get('plugin.manager.block')->getInstance(array('config' => $plugin_id)); $config = $block->getConfig(); @@ -344,6 +345,7 @@ function moveBlockToRegion(array $block, $region) { function testBlockRehash() { module_enable(array('block_test')); $this->assertTrue(module_exists('block_test'), 'Test block module enabled.'); + drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); // Add a test block. $plugin = drupal_container()->get('plugin.manager.block')->getDefinition('test_cache'); @@ -354,6 +356,7 @@ function testBlockRehash() { $block['theme'] = variable_get('theme_default', 'stark'); $block['region'] = 'header'; $this->drupalPost('admin/structure/block/manage/' . $block['id'] . '/' . $block['theme'], array('machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block')); + drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); // Our test block's caching should default to DRUPAL_CACHE_PER_ROLE. $block['config_id'] = 'plugin.core.block.' . $block['theme'] . '.' . $block['machine_name']; @@ -365,6 +368,7 @@ function testBlockRehash() { $block_config = config($block['config_id']); $block_config->set('cache', DRUPAL_NO_CACHE); $block_config->save(); + // Flushing all caches should call _block_rehash(). $this->resetAll(); // Verify that block is updated with the new caching mode. diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php index 3cdbda4..a5d99b3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php @@ -383,27 +383,27 @@ function testMenuHidden() { $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); - $link = $links['menu-test/hidden/menu/manage/%menu']; + $link = $links['menu-test/hidden/menu/manage/%']; $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); - $parent = $links['menu-test/hidden/menu/manage/%menu']; + $parent = $links['menu-test/hidden/menu/manage/%']; $depth = $parent['depth'] + 1; $plid = $parent['mlid']; - $link = $links['menu-test/hidden/menu/manage/%menu/list']; + $link = $links['menu-test/hidden/menu/manage/%/list']; $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); - $link = $links['menu-test/hidden/menu/manage/%menu/add']; + $link = $links['menu-test/hidden/menu/manage/%/add']; $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); - $link = $links['menu-test/hidden/menu/manage/%menu/edit']; + $link = $links['menu-test/hidden/menu/manage/%/edit']; $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); - $link = $links['menu-test/hidden/menu/manage/%menu/delete']; + $link = $links['menu-test/hidden/menu/manage/%/delete']; $this->assertEqual($link['depth'], $depth, format_string('%path depth @link_depth is equal to @depth.', array('%path' => $link['router_path'], '@link_depth' => $link['depth'], '@depth' => $depth))); $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php index 44cab97..ca75762 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php @@ -91,6 +91,7 @@ function testPopularContentBlock() { 'statistics_block_top_all_num' => 3, 'statistics_block_top_last_num' => 3, ); + drupal_container()->get('plugin.manager.block')->clearCachedDefinitions(); $this->drupalPost('admin/structure/block/manage/' . $block_id . '/' . $default_theme, $block, t('Save block')); // Get some page and check if the block is displayed.