diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php index 96bcdc8..25571b9 100644 --- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php @@ -50,9 +50,15 @@ protected function prepareSettings() { $directory = DRUPAL_ROOT . '/' . $this->siteDirectory; copy(DRUPAL_ROOT . '/sites/default/default.settings.php', $directory . '/settings.php'); - // All file system paths are created by System module during installation. + // The public file system path is created during installation. Additionally, + // during tests: + // - The temporary directory is set and created by install_base_system(). + // - The private file directory is created post install by + // FunctionalTestSetupTrait::initConfig(). // @see system_requirements() // @see TestBase::prepareEnvironment() + // @see install_base_system() + // @see \Drupal\Core\Test\FunctionalTestSetupTrait::initConfig() $settings['settings']['file_public_path'] = (object) [ 'value' => $this->publicFilesDirectory, 'required' => TRUE, diff --git a/core/modules/simpletest/src/Tests/WebTestBaseInstallTest.php b/core/modules/simpletest/src/Tests/WebTestBaseInstallTest.php new file mode 100644 index 0000000..857e3a3 --- /dev/null +++ b/core/modules/simpletest/src/Tests/WebTestBaseInstallTest.php @@ -0,0 +1,22 @@ +getTempFilesDirectory() . '/.htaccess'; + $this->assertTrue(file_exists($htaccess_filename), "$htaccess_filename exists"); + } + +} diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 7241fe4..199d257 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -177,4 +177,12 @@ public function testCronRun() { $this->assertGreaterThan($last_cron_time, $next_cron_time); } + /** + * Tests the Drupal install done in \Drupal\Tests\BrowserTestBase::setUp(). + */ + public function testInstall() { + $htaccess_filename = $this->tempFilesDirectory . '/.htaccess'; + $this->assertTrue(file_exists($htaccess_filename), "$htaccess_filename exists"); + } + }