You are here

public function SettingsTest::testConfigDirectoriesBcLayer in Drupal 8

@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']);
}