X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fhal%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FMigrateLinkDomainSettingFromRestToHalUpdateTest.php;fp=web%2Fcore%2Fmodules%2Fhal%2Ftests%2Fsrc%2FFunctional%2FUpdate%2FMigrateLinkDomainSettingFromRestToHalUpdateTest.php;h=1677420752e9a666099bd8b35528287fc8b1fe82;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php b/web/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php new file mode 100644 index 000000000..167742075 --- /dev/null +++ b/web/core/modules/hal/tests/src/Functional/Update/MigrateLinkDomainSettingFromRestToHalUpdateTest.php @@ -0,0 +1,48 @@ +databaseDumpFiles = [ + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.hal-hal_update_8301.php', + __DIR__ . '/../../../fixtures/update/drupal-8.rest-hal_update_8301.php', + ]; + } + + /** + * Tests hal_update_8301(). + */ + public function testLinkDomainMigratedFromRestSettingsToHalSettings() { + // Make sure we have the expected values before the update. + $hal_settings = $this->config('hal.settings'); + $this->assertIdentical([], $hal_settings->getRawData()); + $rest_settings = $this->config('rest.settings'); + $this->assertTrue(array_key_exists('link_domain', $rest_settings->getRawData())); + $this->assertIdentical('http://example.com', $rest_settings->getRawData()['link_domain']); + + $this->runUpdates(); + + // Make sure we have the expected values after the update. + $hal_settings = \Drupal::configFactory()->get('hal.settings'); + $this->assertTrue(array_key_exists('link_domain', $hal_settings->getRawData())); + $this->assertIdentical('http://example.com', $hal_settings->getRawData()['link_domain']); + $rest_settings = $this->config('rest.settings'); + $this->assertFalse(array_key_exists('link_domain', $rest_settings->getRawData())); + } + +}