function SettingsTest::testConfigDirectoriesBcLayer

@runInSeparateProcess @group legacy @covers ::__construct @dataProvider configDirectoriesBcLayerProvider

File

core/tests/Drupal/Tests/Core/Site/SettingsTest.php, line 160

Class

SettingsTest
@coversDefaultClass \Drupal\Core\Site\Settings @group Site

Namespace

Drupal\Tests\Core\Site

Code

public function testConfigDirectoriesBcLayer($settings_file_content, $directory, $expect_deprecation) {
    global $config_directories;
    $class_loader = NULL;
    $vfs_root = vfsStream::setup('root');
    $sites_directory = vfsStream::newDirectory('sites')->at($vfs_root);
    vfsStream::newFile('settings.php')->at($sites_directory)
        ->setContent($settings_file_content);
    if ($expect_deprecation) {
        $this->addExpectedDeprecationMessage('$config_directories[\'sync\'] has moved to $settings[\'config_sync_directory\']. See https://www.drupal.org/node/3018145.');
    }
    Settings::initialize(vfsStream::url('root'), 'sites', $class_loader);
    $this->assertSame($directory, Settings::get('config_sync_directory'));
    $this->assertSame($directory, $config_directories['sync']);
}

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