Commit 9cf2b355 authored by catch's avatar catch
Browse files

Issue #2861622 by alexpott: Running...

Issue #2861622 by alexpott: Running \Drupal\KernelTests\Config\DefaultConfigTest creates a directory called : in DRUPAL_ROOT
parent 01016622
...@@ -37,7 +37,11 @@ abstract class FileTestBase extends KernelTestBase { ...@@ -37,7 +37,11 @@ abstract class FileTestBase extends KernelTestBase {
*/ */
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
// \Drupal\KernelTests\KernelTestBase::bootKernel() sets a global override
// for the default scheme because core relies on it in
// file_default_scheme(). As we are creating the configuration here remove
// the global override.
unset($GLOBALS['config']['system.file']);
\Drupal::configFactory()->getEditable('system.file')->set('default_scheme', 'public')->save(); \Drupal::configFactory()->getEditable('system.file')->set('default_scheme', 'public')->save();
} }
......
...@@ -406,6 +406,11 @@ private function bootKernel() { ...@@ -406,6 +406,11 @@ private function bootKernel() {
// While this should be enforced via settings.php prior to installation, // While this should be enforced via settings.php prior to installation,
// some tests expect to be able to test mail system implementations. // some tests expect to be able to test mail system implementations.
$GLOBALS['config']['system.mail']['interface']['default'] = 'test_mail_collector'; $GLOBALS['config']['system.mail']['interface']['default'] = 'test_mail_collector';
// Manually configure the default file scheme so that modules that use file
// functions don't have to install system and its configuration.
// @see file_default_scheme()
$GLOBALS['config']['system.file']['default_scheme'] = 'public';
} }
/** /**
......
...@@ -205,6 +205,14 @@ public function testRenderWithTheme() { ...@@ -205,6 +205,14 @@ public function testRenderWithTheme() {
$this->assertRegExp($expected, (string) $output); $this->assertRegExp($expected, (string) $output);
} }
/**
* @covers ::bootKernel
*/
public function testFileDefaultScheme() {
$this->assertEquals('public', file_default_scheme());
$this->assertEquals('public', \Drupal::config('system.file')->get('default_scheme'));
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment