function ConfigSyncReadmeUpdateTest::testConfigurationSynchronizationReadmeUpdate

Same name in other branches
  1. 11.x core/modules/system/tests/src/Functional/Update/ConfigSyncReadmeUpdateTest.php \Drupal\Tests\system\Functional\Update\ConfigSyncReadmeUpdateTest::testConfigurationSynchronizationReadmeUpdate()

Tests configuration synchronization readme file update.

File

core/modules/system/tests/src/Functional/Update/ConfigSyncReadmeUpdateTest.php, line 35

Class

ConfigSyncReadmeUpdateTest
Tests update to readme inside the configuration synchronization directory.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testConfigurationSynchronizationReadmeUpdate() : void {
    $readme_path = Settings::get('config_sync_directory') . '/README.txt';
    // The test setup does not write the configuration synchronization
    // directory, so let us do it here instead.
    file_put_contents($readme_path, 'Original content had admin/config/development/configuration/sync as path');
    $readme_content = file_get_contents($readme_path);
    $this->assertStringContainsString('admin/config/development/configuration/sync', $readme_content);
    $this->runUpdates();
    $readme_content = file_get_contents($readme_path);
    $this->assertStringNotContainsString('admin/config/development/configuration/sync', $readme_content);
    $this->assertStringContainsString('admin/config/development/configuration', $readme_content);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.