function ConfigImportUITest::testImportSiteUuidValidation
Same name in other branches
- 9 core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testImportSiteUuidValidation()
- 10 core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testImportSiteUuidValidation()
- 11.x core/modules/config/tests/src/Functional/ConfigImportUITest.php \Drupal\Tests\config\Functional\ConfigImportUITest::testImportSiteUuidValidation()
Tests verification of site UUID before importing configuration.
File
-
core/
modules/ config/ tests/ src/ Functional/ ConfigImportUITest.php, line 261
Class
- ConfigImportUITest
- Tests the user interface for importing configuration.
Namespace
Drupal\Tests\config\FunctionalCode
public function testImportSiteUuidValidation() {
$sync = \Drupal::service('config.storage.sync');
// Create updated configuration object.
$config_data = $this->config('system.site')
->get();
// Generate a new site UUID.
$config_data['uuid'] = \Drupal::service('uuid')->generate();
$sync->write('system.site', $config_data);
// Verify that there are configuration differences to import.
$this->drupalGet('admin/config/development/configuration');
$this->assertText(t('The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.'));
$this->assertNoFieldById('edit-submit', t('Import all'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.