X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Ftests%2FDrupal%2FFunctionalTests%2FInstaller%2FInstallerConfigDirectorySetNoDirectoryErrorTest.php;fp=web%2Fcore%2Ftests%2FDrupal%2FFunctionalTests%2FInstaller%2FInstallerConfigDirectorySetNoDirectoryErrorTest.php;h=7de0652fe93efd281c7b54431e4b4bfa49a8741f;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php new file mode 100644 index 000000000..7de0652fe --- /dev/null +++ b/web/core/tests/Drupal/FunctionalTests/Installer/InstallerConfigDirectorySetNoDirectoryErrorTest.php @@ -0,0 +1,61 @@ +configDirectory = $this->publicFilesDirectory . '/config_' . Crypt::randomBytesBase64(); + $this->settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [ + 'value' => $this->configDirectory . '/sync', + 'required' => TRUE, + ]; + // Create the files directory early so we can test the error case. + mkdir($this->publicFilesDirectory); + // Create a file so the directory can not be created. + file_put_contents($this->configDirectory, 'Test'); + } + + /** + * Installer step: Configure settings. + */ + protected function setUpSettings() { + // This step should not appear as we had a failure prior to the settings + // screen. + } + + /** + * {@inheritdoc} + */ + protected function setUpSite() { + // This step should not appear as we had a failure prior to the settings + // screen. + } + + /** + * Verifies that installation failed. + */ + public function testError() { + $this->assertText("An automated attempt to create the directory {$this->configDirectory}/sync failed, possibly due to a permissions problem."); + $this->assertFalse(file_exists($this->configDirectory . '/sync') && is_dir($this->configDirectory . '/sync'), "The directory {$this->configDirectory}/sync does not exist."); + } + +}