79882b428a8fae80b164519cf89cfd4d6b6eed32
[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\FunctionalTests\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  * @group legacy
14  */
15 class CreateHalSettingsForLinkDomainUpdateTest extends UpdatePathTestBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function setDatabaseDumpFiles() {
21     $this->databaseDumpFiles = [
22       __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
23       __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php',
24     ];
25   }
26
27   /**
28    * Tests hal_update_8301().
29    */
30   public function testHalSettingsCreated() {
31     // Make sure we have the expected values before the update.
32     $hal_settings = $this->config('hal.settings');
33     $this->assertIdentical([], $hal_settings->getRawData());
34
35     $this->runUpdates();
36
37     // Make sure we have the expected values after the update.
38     $hal_settings = \Drupal::configFactory()->get('hal.settings');
39     $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData()));
40     $this->assertIdentical(NULL, $hal_settings->getRawData()['link_domain']);
41   }
42
43 }