InstallProfileSystemInstall8300Test.php 1.47 KB
Newer Older
1 2
<?php

3
namespace Drupal\Tests\system\Functional\Update;
4 5

use Drupal\Core\Site\Settings;
6
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
7 8 9 10 11 12 13 14 15 16 17 18 19

/**
 * Tests system_update_8300().
 *
 * @group Update
 */
class InstallProfileSystemInstall8300Test extends UpdatePathTestBase {

  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() {
    $this->databaseDumpFiles = [
20
      __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    ];
  }

  /**
   * Ensures that the system_update_8300() runs as expected.
   */
  public function testUpdate() {
    // Ensure the BC layers work and settings.php and configuration is in the
    // expected state before updating.
    $this->assertEqual('standard', \Drupal::installProfile());
    $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.');
    $this->assertFalse($this->config('core.extension')->get('profile'), 'The install profile is not present in core.extension configuration.');

    $this->runUpdates();
    // Confirm that Drupal recognizes this distribution as the current profile.
    $this->assertEqual('standard', \Drupal::installProfile());
    $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.');
    $this->assertEqual('standard', $this->config('core.extension')->get('profile'), 'The install profile has been written to core.extension configuration.');
  }

}