function SystemFilesTest::prepareSettings
Prepares site settings and services before installation.
Overrides FunctionalTestSetupTrait::prepareSettings
File
-
core/
tests/ Drupal/ FunctionalTests/ Routing/ SystemFilesTest.php, line 27
Class
- SystemFilesTest
- Tests system.files route.
Namespace
Drupal\FunctionalTests\RoutingCode
protected function prepareSettings() : void {
parent::prepareSettings();
// Allow info files to be accessed by the `module` and `theme` stream
// wrappers.
$services_file = $this->siteDirectory . '/services.yml';
$this->assertFileExists($services_file);
$services = file_get_contents($services_file);
$services = Yaml::decode($services);
$services['parameters']['stream_wrapper.allowed_file_extensions'] = [
'module' => [
'yml',
],
'theme' => [
'yml',
],
];
file_put_contents($services_file, Yaml::encode($services));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.