$settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml';
} // Copy the testing-specific service overrides in place.
copy($settings_services_file,
$directory . '/services.yml'
);
if ($this->strictConfigSchema
) { // Add a listener to validate configuration schema on save.
$yaml =
new SymfonyYaml();
$content =
file_get_contents($directory . '/services.yml'
);
$services =
$yaml->
parse($content);
$services['services'
]['testing.config_schema_checker'
] =
[ 'class' => ConfigSchemaChecker::
class,
'arguments' =>
['@config.typed',
$this->
getConfigSchemaExclusions()],
'tags' =>
[['name' => 'event_subscriber'
]],
];
file_put_contents($directory . '/services.yml',
$yaml->
dump($services));
} // Since Drupal is bootstrapped already, install_begin_request() will not
// bootstrap again. Hence, we have to reload the newly written custom
// settings.php manually.
Settings::
initialize(DRUPAL_ROOT,
$this->siteDirectory,
$this->classLoader
);
} /**
* Rewrites the settings.php file of the test site.
*
* @param array $settings
* An array of settings to write out, in the format expected by
* SettingsEditor::rewrite().
*
* @see \Drupal\Core\Site\SettingsEditor::rewrite()
*/