You are here

public function WarmCacheUpdateFrom8dot6Test::testWithMissingProfile in Drupal 8

Tests system_update_8601().

File

core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php, line 57

Class

WarmCacheUpdateFrom8dot6Test
Updates from 8.6.0 with warm caches.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testWithMissingProfile() {

  // Remove the install profile from the module list to simulate how Drush 8
  // and update_fix_compatibility() worked together to remove the install
  // profile. See https://www.drupal.org/project/drupal/issues/3031740.
  $connection = Database::getConnection();
  $config = $connection
    ->select('config')
    ->fields('config', [
    'data',
  ])
    ->condition('collection', '')
    ->condition('name', 'core.extension')
    ->execute()
    ->fetchField();
  $config = unserialize($config);
  unset($config['module']['minimal']);
  $connection
    ->update('config')
    ->fields([
    'data' => serialize($config),
    'collection' => '',
    'name' => 'core.extension',
  ])
    ->condition('collection', '')
    ->condition('name', 'core.extension')
    ->execute();
  $this
    ->runUpdates();
  $this
    ->assertSession()
    ->pageTextContains('The minimal install profile has been added to the installed module list.');

  // Login and check that the status report is working correctly.
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet('admin/reports/status');
  $this
    ->assertSession()
    ->pageTextContains("Installation Profile Minimal");
}