Skip to content
Snippets Groups Projects
Select Git revision
  • 38e9b30c2b48bb37b75e98a14e904abd181fe8b4
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

LayoutManager.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ModulesDisabledUpgradePathTest.php 1.93 KiB
    <?php
    
    /**
     * @file
     * Definition of Drupal\system\Tests\Upgrade\ModulesDisabledUpgradePathTest.
     */
    
    namespace Drupal\system\Tests\Upgrade;
    
    /**
     * Tests upgrading with all non-required modules installed but disabled.
     *
     * Loads a filled installation of Drupal 7 with disabled modules and runs the
     * upgrade process on it.
     */
    class ModulesDisabledUpgradePathTest extends UpgradePathTestBase {
      public static function getInfo() {
        return array(
          'name'  => 'Modules disabled upgrade test',
          'description'  => 'Upgrade path test for disabled modules.',
          'group' => 'Upgrade path',
        );
      }
    
      public function setUp() {
        $this->databaseDumpFiles = array(
          drupal_get_path('module', 'system') . '/tests/upgrade/drupal-7.filled.standard_all.database.php.gz',
          drupal_get_path('module', 'system') . '/tests/upgrade/drupal-7.all-disabled.database.php',
        );
        parent::setUp();
      }
    
      /**
       * Tests an upgrade with all non-required modules installed but disabled.
       */
      public function testDisabledUpgrade() {
        $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
    
        // Get enabled modules.
        $enabled = module_list();
        // Get all available modules.
        $available = system_rebuild_module_data();
        // Filter out hidden test modules.
        foreach ($available as $module => $data) {
          if (!empty($data->info['hidden'])) {
            unset($available[$module]);
          }
        }
        $to_enable = array_diff_key($available, $enabled);
        module_enable(array_keys($to_enable));
        // Check for updates.
        require_once DRUPAL_ROOT . '/core/includes/update.inc';
        require_once DRUPAL_ROOT . '/core/includes/install.inc';
        $updates = update_get_update_list();
        $this->assertEqual($updates, array(), 'No pending updates after enabling all modules.');
        $this->assertTrue(state()->get('update_test_1_update_dependencies_run'), 'Module update dependencies resolved for disabled modules');
      }
    }