diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php index 65c30de..f52bbf6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php @@ -7,6 +7,8 @@ namespace Drupal\system\Tests\Upgrade; +use Symfony\Component\DependencyInjection\Reference; + /** * Tests upgrading a filled database with language data. * @@ -38,6 +40,12 @@ public function testLanguageUpgrade() { db_update('users')->fields(array('language' => 'ca'))->condition('uid', '1')->execute(); $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + // node_load() requires the field cache. + drupal_container()->register('cache.field', 'Drupal\Core\Cache\DatabaseBackend') + ->addArgument('field') + ->addArgument(new Reference('database')) + ->addTag('cache'); + // Ensure Catalan was properly upgraded to be the new default language. $this->assertTrue(language_default()->langcode == 'ca', t('Catalan is the default language')); $languages = language_list(LANGUAGE_ALL); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php index c4c6f75..1b344d1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php @@ -7,6 +7,8 @@ namespace Drupal\system\Tests\Upgrade; +use Symfony\Component\DependencyInjection\Reference; + /** * Tests upgrading with all non-required modules installed but disabled. * @@ -36,6 +38,16 @@ public function setUp() { public function testDisabledUpgrade() { $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); + // Enable necessary caches. + drupal_container()->register('cache.field', 'Drupal\Core\Cache\DatabaseBackend') + ->addArgument('field') + ->addArgument(new Reference('database')) + ->addTag('cache'); + drupal_container()->register('cache.menu', 'Drupal\Core\Cache\DatabaseBackend') + ->addArgument('menu') + ->addArgument(new Reference('database')) + ->addTag('cache'); + // Get enabled modules. $enabled = module_list(); // Get all available modules. diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php index 6598e06..22fbf53 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php @@ -7,10 +7,10 @@ namespace Drupal\system\Tests\Upgrade; -use Drupal\Core\Database\Database; use Drupal\simpletest\WebTestBase; use Exception; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Reference; /** * Perform end-to-end tests of the upgrade path. @@ -257,6 +257,14 @@ protected function performUpgrade($register_errors = TRUE) { // Reload global $conf array and permissions. $this->refreshVariables(); + + // filter_permission() calls url(), make sure that the path cache + // service exists. + drupal_container()->register('cache.path', 'Drupal\Core\Cache\DatabaseBackend') + ->addArgument('path') + ->addArgument(new Reference('database')) + ->addTag('cache'); + $this->checkPermissions(array(), TRUE); return TRUE;