Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / hal / tests / src / Functional / Update / CreateHalSettingsForLinkDomainUpdateTest.php
1 <?php
2
3 namespace Drupal\Tests\hal\Functional\Update;
4
5 use Drupal\system\Tests\Update\UpdatePathTestBase;
6
7 /**
8  * Tests that 'hal.settings' is created, to store 'link_domain'.
9  *
10  * @see https://www.drupal.org/node/2758897
11  *
12  * @group hal
13  */
14 class CreateHalSettingsForLinkDomainUpdateTest extends UpdatePathTestBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function setDatabaseDumpFiles() {
20     $this->databaseDumpFiles = [
21       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
22       __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php',
23     ];
24   }
25
26   /**
27    * Tests hal_update_8301().
28    */
29   public function testHalSettingsCreated() {
30     // Make sure we have the expected values before the update.
31     $hal_settings = $this->config('hal.settings');
32     $this->assertIdentical([], $hal_settings->getRawData());
33
34     $this->runUpdates();
35
36     // Make sure we have the expected values after the update.
37     $hal_settings = \Drupal::configFactory()->get('hal.settings');
38     $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData()));
39     $this->assertIdentical(NULL, $hal_settings->getRawData()['link_domain']);
40   }
41
42 }