Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / system / tests / src / Functional / Update / InstallProfileSystemInstall8300Test.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\Update;
4
5 use Drupal\Core\Site\Settings;
6 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
7
8 /**
9  * Tests system_update_8300().
10  *
11  * @group Update
12  * @group legacy
13  */
14 class InstallProfileSystemInstall8300Test extends UpdatePathTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   protected function setDatabaseDumpFiles() {
20     $this->databaseDumpFiles = [
21       __DIR__ . '/../../../../tests/fixtures/update/drupal-8.bare.standard.php.gz',
22     ];
23   }
24
25   /**
26    * Ensures that the system_update_8300() runs as expected.
27    *
28    * @expectedDeprecation To access the install profile in Drupal 8 use \Drupal::installProfile() or inject the install_profile container parameter into your service. See https://www.drupal.org/node/2538996
29    */
30   public function testUpdate() {
31     // Ensure the BC layers work and settings.php and configuration is in the
32     // expected state before updating.
33     $this->assertEqual('standard', \Drupal::installProfile());
34     $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.');
35     $this->assertFalse($this->config('core.extension')->get('profile'), 'The install profile is not present in core.extension configuration.');
36
37     $this->runUpdates();
38     // Confirm that Drupal recognizes this distribution as the current profile.
39     $this->assertEqual('standard', \Drupal::installProfile());
40     $this->assertEqual('standard', Settings::get('install_profile'), 'The install profile has not been written to settings.php.');
41     $this->assertEqual('standard', $this->config('core.extension')->get('profile'), 'The install profile has been written to core.extension configuration.');
42   }
43
44 }