From 342f8efe7903e7d845e29f9eacd2c85a34f9d964 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 11:34:42 +1000 Subject: [PATCH 01/12] [#3115] Settled the installer file predicates on 'File::*' and removed the duplicated checks. Existence is asked two ways instead of four, chosen by intent: 'File::exists()' where a path is being detected and may be a directory, and a new 'File::isReadable()' where a regular file is about to be read. 'is_dir()' stays, since it asks whether a path is a directory rather than whether it exists. The Vortex badge now has one pattern, 'Version::BADGE_REGEX', so detection means a reference is parseable rather than merely that the label is present. 'Tui::caretEol()' measures with 'Strings::strlenPlain()' like every sibling, so a coloured or multibyte line no longer moves the caret by its byte count. 'RepositoryDownloader' reads 'GITHUB_TOKEN' once and reports it from the headers it sent, so a plain-HTTP failure no longer claims a token was used when it was withheld. 'InstallerPresenterTest' builds its config through a helper, and the uniform 'prepareDestination', 'prepareDemo' and 'validate' groups became data providers. --- .../installer/src/Command/InstallCommand.php | 4 +- .vortex/installer/src/Downloader/Archiver.php | 2 +- .../src/Downloader/RepositoryDownloader.php | 11 +- .../src/Prompts/Handlers/AssignAuthorPr.php | 2 +- .../src/Prompts/Handlers/CiProvider.php | 4 +- .../Prompts/Handlers/CodeCoverageProvider.php | 4 +- .../src/Prompts/Handlers/CodeProvider.php | 6 +- .../Handlers/DependencyUpdatesProvider.php | 4 +- .../installer/src/Prompts/Handlers/Dotenv.php | 3 +- .../src/Prompts/Handlers/Gitleaks.php | 2 +- .../Prompts/Handlers/HostingProjectName.php | 4 +- .../src/Prompts/Handlers/HostingProvider.php | 4 +- .../src/Prompts/Handlers/Internal.php | 4 +- .../Handlers/LabelMergeConflictsPr.php | 2 +- .../src/Prompts/Handlers/Modules.php | 2 +- .../Prompts/Handlers/PreserveDocsProject.php | 2 +- .../installer/src/Prompts/Handlers/Theme.php | 8 +- .../src/Prompts/Handlers/VisualRegression.php | 2 +- .vortex/installer/src/Utils/Env.php | 6 +- .vortex/installer/src/Utils/File.php | 10 + .vortex/installer/src/Utils/FileManager.php | 20 +- .../installer/src/Utils/JsonManipulator.php | 2 +- .vortex/installer/src/Utils/NpmLock.php | 2 +- .../installer/src/Utils/OptionsResolver.php | 10 +- .vortex/installer/src/Utils/Tui.php | 2 +- .../installer/src/Utils/UpdateRegistry.php | 2 +- .vortex/installer/src/Utils/Version.php | 18 +- .vortex/installer/src/Utils/Yaml.php | 2 +- .../Downloader/RepositoryDownloaderTest.php | 211 +++++++++------- .../Unit/Prompts/InstallerPresenterTest.php | 41 ++-- .../tests/Unit/Utils/FileManagerTest.php | 228 +++++++----------- 31 files changed, 312 insertions(+), 312 deletions(-) diff --git a/.vortex/installer/src/Command/InstallCommand.php b/.vortex/installer/src/Command/InstallCommand.php index 1ed72b4471..2f939c9c6f 100644 --- a/.vortex/installer/src/Command/InstallCommand.php +++ b/.vortex/installer/src/Command/InstallCommand.php @@ -333,7 +333,7 @@ protected function handleValidate(InputInterface $input, OutputInterface $output return Command::FAILURE; } - $prompts_json = is_file($prompts_option) ? (string) file_get_contents($prompts_option) : $prompts_option; + $prompts_json = File::isReadable($prompts_option) ? File::read($prompts_option) : $prompts_option; $decoded = json_decode($prompts_json); if (!$decoded instanceof \stdClass) { @@ -437,7 +437,7 @@ public function cleanup(): void { } $phar_path = \Phar::running(FALSE); - if (!empty($phar_path) && file_exists($phar_path)) { + if (!empty($phar_path) && File::exists($phar_path)) { File::remove($phar_path); } } diff --git a/.vortex/installer/src/Downloader/Archiver.php b/.vortex/installer/src/Downloader/Archiver.php index 1d18e36922..d97cc42f1c 100644 --- a/.vortex/installer/src/Downloader/Archiver.php +++ b/.vortex/installer/src/Downloader/Archiver.php @@ -53,7 +53,7 @@ public function detectFormat(string $archive_path): ?string { * {@inheritdoc} */ public function validate(string $archive_path): void { - if (!file_exists($archive_path)) { + if (!File::exists($archive_path)) { throw new \RuntimeException(sprintf('Archive file does not exist: "%s".', $archive_path)); } diff --git a/.vortex/installer/src/Downloader/RepositoryDownloader.php b/.vortex/installer/src/Downloader/RepositoryDownloader.php index 2a1e20333b..4f52ed2c4a 100644 --- a/.vortex/installer/src/Downloader/RepositoryDownloader.php +++ b/.vortex/installer/src/Downloader/RepositoryDownloader.php @@ -56,7 +56,7 @@ public function download(Artifact $artifact, ?string $destination = NULL, ?strin $version = $this->downloadFromLocal($artifact, $destination); } - if (!is_readable($destination . '/composer.json')) { + if (!File::isReadable($destination . '/composer.json')) { throw new \RuntimeException('The downloaded repository does not contain a composer.json file.'); } @@ -177,7 +177,6 @@ protected function discoverLatestReleaseRemote(string $repo_url, ?string $releas $release_url = sprintf('https://api.github.com/repos/%s/releases', $path); $headers = self::requestHeaders($release_url, ['Accept' => 'application/vnd.github.v3+json']); - $github_token = Env::get('GITHUB_TOKEN'); try { $response = $this->httpClient->request('GET', $release_url, ['headers' => $headers]); @@ -188,7 +187,7 @@ protected function discoverLatestReleaseRemote(string $repo_url, ?string $releas } if ($release_contents === '' || $release_contents === '0') { - $message = sprintf('Unable to download release information from "%s"%s.', $release_url, $github_token ? ' (GitHub token was used)' : ''); + $message = sprintf('Unable to download release information from "%s"%s.', $release_url, isset($headers['Authorization']) ? ' (GitHub token was used)' : ''); throw new \RuntimeException($message); } @@ -228,7 +227,7 @@ protected function downloadArchive(string $url): string { $this->fileDownloader->download($url, $temp_file, self::requestHeaders($url)); } catch (\RuntimeException $e) { - if (file_exists($temp_file)) { + if (File::exists($temp_file)) { File::remove($temp_file); } throw new \RuntimeException(sprintf('Unable to download archive from "%s": %s.', $url, $e->getMessage()), $e->getCode(), $e); @@ -261,12 +260,12 @@ protected function archiveFromLocal(string $repo, string $ref): string { try { $this->git->run('archive', '--format=tar', $ref, '-o', $temp_file); - if (!file_exists($temp_file) || filesize($temp_file) === 0) { + if (!File::exists($temp_file) || filesize($temp_file) === 0) { throw new \RuntimeException('Archive creation produced empty file.'); } } catch (\Exception $e) { - if (file_exists($temp_file)) { + if (File::exists($temp_file)) { File::remove($temp_file); } throw new \RuntimeException(sprintf('Unable to create archive from local repository "%s": %s.', $repo, $e->getMessage()), $e->getCode(), $e); diff --git a/.vortex/installer/src/Prompts/Handlers/AssignAuthorPr.php b/.vortex/installer/src/Prompts/Handlers/AssignAuthorPr.php index 3f1e4be7e5..4a0622efd1 100644 --- a/.vortex/installer/src/Prompts/Handlers/AssignAuthorPr.php +++ b/.vortex/installer/src/Prompts/Handlers/AssignAuthorPr.php @@ -37,7 +37,7 @@ public function discover(): null|string|bool|array { return NULL; } - return file_exists($this->destinationDir . '/.github/workflows/assign-author.yml'); + return File::exists($this->destinationDir . '/.github/workflows/assign-author.yml'); } /** diff --git a/.vortex/installer/src/Prompts/Handlers/CiProvider.php b/.vortex/installer/src/Prompts/Handlers/CiProvider.php index fe3ed12044..15ead9f93f 100644 --- a/.vortex/installer/src/Prompts/Handlers/CiProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/CiProvider.php @@ -60,11 +60,11 @@ public function discover(): null|string|bool|array { return NULL; } - if (is_readable($this->destinationDir . '/.github/workflows/build-test-deploy.yml')) { + if (File::exists($this->destinationDir . '/.github/workflows/build-test-deploy.yml')) { return self::GITHUB_ACTIONS; } - if (is_readable($this->destinationDir . '/.circleci/config.yml')) { + if (File::exists($this->destinationDir . '/.circleci/config.yml')) { return self::CIRCLECI; } diff --git a/.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php b/.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php index d17b6bd11f..41c515ff19 100644 --- a/.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/CodeCoverageProvider.php @@ -53,13 +53,13 @@ public function discover(): null|string|bool|array { $gha_files = glob($this->destinationDir . '/.github/workflows/*.{yml,yaml}', GLOB_BRACE) ?: []; foreach ($gha_files as $gha_file) { - if (is_readable($gha_file) && File::contains($gha_file, 'codecov/codecov-action')) { + if (File::contains($gha_file, 'codecov/codecov-action')) { return self::CODECOV; } } $circle = $this->destinationDir . '/.circleci/config.yml'; - if (is_readable($circle) && File::contains($circle, 'codecov -Z -s')) { + if (File::contains($circle, 'codecov -Z -s')) { return self::CODECOV; } diff --git a/.vortex/installer/src/Prompts/Handlers/CodeProvider.php b/.vortex/installer/src/Prompts/Handlers/CodeProvider.php index e54df77294..c8fe183286 100644 --- a/.vortex/installer/src/Prompts/Handlers/CodeProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/CodeProvider.php @@ -54,11 +54,11 @@ public function default(array $responses): null|string|bool|array { * {@inheritdoc} */ public function discover(): null|string|bool|array { - if (file_exists($this->destinationDir . '/.github')) { + if (File::exists($this->destinationDir . '/.github')) { return self::GITHUB; } - return $this->isInstalled() && file_exists($this->destinationDir . '/.git') ? self::OTHER : NULL; + return $this->isInstalled() && File::exists($this->destinationDir . '/.git') ? self::OTHER : NULL; } /** @@ -71,7 +71,7 @@ public function process(): void { if ($v === self::GITHUB) { File::remove($t . '/.github/PULL_REQUEST_TEMPLATE.md'); - if (file_exists($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md')) { + if (File::exists($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md')) { rename($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md', $t . '/.github/PULL_REQUEST_TEMPLATE.md'); } } diff --git a/.vortex/installer/src/Prompts/Handlers/DependencyUpdatesProvider.php b/.vortex/installer/src/Prompts/Handlers/DependencyUpdatesProvider.php index b29b8ecbe1..cc94eb3bb9 100644 --- a/.vortex/installer/src/Prompts/Handlers/DependencyUpdatesProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/DependencyUpdatesProvider.php @@ -54,11 +54,11 @@ public function discover(): null|string|bool|array { return NULL; } - if (!is_readable($this->destinationDir . '/renovate.json')) { + if (!File::exists($this->destinationDir . '/renovate.json')) { return self::NONE; } - if (file_exists($this->destinationDir . '/.github/workflows/update-dependencies.yml')) { + if (File::exists($this->destinationDir . '/.github/workflows/update-dependencies.yml')) { return self::RENOVATEBOT_CI; } diff --git a/.vortex/installer/src/Prompts/Handlers/Dotenv.php b/.vortex/installer/src/Prompts/Handlers/Dotenv.php index 4fad17b53d..fe03bd31b8 100644 --- a/.vortex/installer/src/Prompts/Handlers/Dotenv.php +++ b/.vortex/installer/src/Prompts/Handlers/Dotenv.php @@ -5,6 +5,7 @@ namespace DrevOps\VortexInstaller\Prompts\Handlers; use DrevOps\VortexInstaller\Utils\Env; +use DrevOps\VortexInstaller\Utils\File; class Dotenv extends AbstractHandler { @@ -22,7 +23,7 @@ public function discover(): null|string|bool|array { public function process(): void { $t = $this->tmpDir; - if (is_readable($this->destinationDir . '/.env')) { + if (File::exists($this->destinationDir . '/.env')) { $variables = Env::parseDotenv($this->destinationDir . '/.env'); foreach ($variables as $name => $value) { Env::writeValueDotenv($name, $value, $t . '/.env'); diff --git a/.vortex/installer/src/Prompts/Handlers/Gitleaks.php b/.vortex/installer/src/Prompts/Handlers/Gitleaks.php index 483749eafa..ba9c0d8c4a 100644 --- a/.vortex/installer/src/Prompts/Handlers/Gitleaks.php +++ b/.vortex/installer/src/Prompts/Handlers/Gitleaks.php @@ -44,7 +44,7 @@ public function discover(): null|string|bool|array { return NULL; } - return file_exists($this->destinationDir . '/.gitleaks.toml'); + return File::exists($this->destinationDir . '/.gitleaks.toml'); } /** diff --git a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php index e5efc2b09f..f1ce48061e 100644 --- a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php +++ b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php @@ -81,7 +81,7 @@ public function discover(): null|string|bool|array { // instead of a hardcoded project name. Kept for backward compatibility // with older installations. $acquia_settings_file = $this->destinationDir . sprintf('/%s/sites/default/includes/providers/settings.acquia.php', $this->webroot); - if (file_exists($acquia_settings_file)) { + if (File::exists($acquia_settings_file)) { $content = file_get_contents($acquia_settings_file); // Require '/var/www/site-php/your_site/your_site-settings.inc';. if ($content !== FALSE && preg_match('/require\s+[\'"]\/var\/www\/site-php\/([a-z0-9_]+)\/[a-z0-9_]+-settings\.inc[\'"]\s*;/', $content, $matches) && !empty($matches[1])) { @@ -95,7 +95,7 @@ public function discover(): null|string|bool|array { } $lagoon_site_file = $this->destinationDir . '/drush/sites/lagoon.site.yml'; - if (file_exists($lagoon_site_file)) { + if (File::exists($lagoon_site_file)) { $content = file_get_contents($lagoon_site_file); if ($content !== FALSE && preg_match('/user:\s*([a-z0-9_]+)-/', $content, $matches) && (!empty($matches[1]) && $matches[1] !== 'your_site')) { return $matches[1]; diff --git a/.vortex/installer/src/Prompts/Handlers/HostingProvider.php b/.vortex/installer/src/Prompts/Handlers/HostingProvider.php index 928258f2a3..099c126d87 100644 --- a/.vortex/installer/src/Prompts/Handlers/HostingProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/HostingProvider.php @@ -62,11 +62,11 @@ public function default(array $responses): null|string|bool|array { * {@inheritdoc} */ public function discover(): null|string|bool|array { - if (is_readable($this->destinationDir . '/hooks') || Env::getFromDotenv('VORTEX_FETCH_DB_SOURCE', $this->destinationDir) === DatabaseFetchSource::ACQUIA) { + if (File::exists($this->destinationDir . '/hooks') || Env::getFromDotenv('VORTEX_FETCH_DB_SOURCE', $this->destinationDir) === DatabaseFetchSource::ACQUIA) { return self::ACQUIA; } - if (is_readable($this->destinationDir . '/.lagoon.yml')) { + if (File::exists($this->destinationDir . '/.lagoon.yml')) { return self::LAGOON; } diff --git a/.vortex/installer/src/Prompts/Handlers/Internal.php b/.vortex/installer/src/Prompts/Handlers/Internal.php index c95b5d2668..0d4653066a 100644 --- a/.vortex/installer/src/Prompts/Handlers/Internal.php +++ b/.vortex/installer/src/Prompts/Handlers/Internal.php @@ -77,7 +77,7 @@ public function process(): void { return $content; }); - if (file_exists($t . '/README.dist.md')) { + if (File::exists($t . '/README.dist.md')) { rename($t . '/README.dist.md', $t . '/README.md'); } @@ -162,7 +162,7 @@ protected function processDemoMode(array $responses, string $dir): void { $is_demo = FALSE; } elseif ($responses[ProvisionType::id()] === ProvisionType::DATABASE) { - $db_file_exists = file_exists(Env::get('VORTEX_DB_DIR', './.data') . '/' . Env::get('VORTEX_DB_FILE', 'db.sql')); + $db_file_exists = File::exists(Env::get('VORTEX_DB_DIR', './.data') . '/' . Env::get('VORTEX_DB_FILE', 'db.sql')); $has_comment = File::contains($this->destinationDir . '/.env', 'Override project-specific values for demonstration purposes'); // Demo mode applies only to the URL and container registry download diff --git a/.vortex/installer/src/Prompts/Handlers/LabelMergeConflictsPr.php b/.vortex/installer/src/Prompts/Handlers/LabelMergeConflictsPr.php index 8320f38bb2..ea1f0c8cbc 100644 --- a/.vortex/installer/src/Prompts/Handlers/LabelMergeConflictsPr.php +++ b/.vortex/installer/src/Prompts/Handlers/LabelMergeConflictsPr.php @@ -37,7 +37,7 @@ public function discover(): null|string|bool|array { return NULL; } - return file_exists($this->destinationDir . '/.github/workflows/label-merge-conflict.yml'); + return File::exists($this->destinationDir . '/.github/workflows/label-merge-conflict.yml'); } /** diff --git a/.vortex/installer/src/Prompts/Handlers/Modules.php b/.vortex/installer/src/Prompts/Handlers/Modules.php index 3cf545b4c1..1b6ec7e855 100644 --- a/.vortex/installer/src/Prompts/Handlers/Modules.php +++ b/.vortex/installer/src/Prompts/Handlers/Modules.php @@ -185,7 +185,7 @@ public static function getAvailableModules(): array { * Array of module machine names (without drupal/ prefix), or NULL on error. */ protected function getModulesFromComposerFile(string $composer_file): ?array { - if (!file_exists($composer_file)) { + if (!File::isReadable($composer_file)) { return NULL; } diff --git a/.vortex/installer/src/Prompts/Handlers/PreserveDocsProject.php b/.vortex/installer/src/Prompts/Handlers/PreserveDocsProject.php index de83c391ad..25f518a5ea 100644 --- a/.vortex/installer/src/Prompts/Handlers/PreserveDocsProject.php +++ b/.vortex/installer/src/Prompts/Handlers/PreserveDocsProject.php @@ -37,7 +37,7 @@ public function discover(): null|string|bool|array { return NULL; } - return file_exists($this->destinationDir . '/docs/README.md'); + return File::exists($this->destinationDir . '/docs/README.md'); } /** diff --git a/.vortex/installer/src/Prompts/Handlers/Theme.php b/.vortex/installer/src/Prompts/Handlers/Theme.php index 106bee8aea..a091f087e7 100644 --- a/.vortex/installer/src/Prompts/Handlers/Theme.php +++ b/.vortex/installer/src/Prompts/Handlers/Theme.php @@ -127,7 +127,7 @@ public function process(): void { if (in_array($v, [self::OLIVERO, self::CLARO, self::STARK])) { $file_tmpl = self::findThemeFile($t, $w); - if (!empty($file_tmpl) && is_readable($file_tmpl)) { + if (!empty($file_tmpl) && File::exists($file_tmpl)) { File::remove(dirname($file_tmpl)); File::rmdirIfEmpty(dirname($file_tmpl)); @@ -149,7 +149,7 @@ public function process(): void { if ($this->isInstalled() && (empty($file_dst) || !self::isVortexTheme(dirname($file_dst)))) { $file_tmpl = self::findThemeFile($t, $w); - if (!empty($file_tmpl) && is_readable($file_tmpl)) { + if (!empty($file_tmpl) && File::exists($file_tmpl)) { File::remove(dirname($file_tmpl)); } } @@ -211,8 +211,8 @@ protected static function findThemeFile(string $dir, string $webroot, ?string $t } protected static function isVortexTheme(string $dir): bool { - $c1 = file_exists($dir . '/scss/_variables.scss'); - $c2 = file_exists($dir . '/package.json'); + $c1 = File::exists($dir . '/scss/_variables.scss'); + $c2 = File::exists($dir . '/package.json'); $c3 = File::contains($dir . '/package.json', 'build-dev'); return $c1 && $c2 && $c3; diff --git a/.vortex/installer/src/Prompts/Handlers/VisualRegression.php b/.vortex/installer/src/Prompts/Handlers/VisualRegression.php index 5c14bfffd0..bbf74ed8a9 100644 --- a/.vortex/installer/src/Prompts/Handlers/VisualRegression.php +++ b/.vortex/installer/src/Prompts/Handlers/VisualRegression.php @@ -60,7 +60,7 @@ public function discover(): null|string|bool|array { return NULL; } - return file_exists($this->destinationDir . '/.github/workflows/test-vr.yml'); + return File::exists($this->destinationDir . '/.github/workflows/test-vr.yml'); } /** diff --git a/.vortex/installer/src/Utils/Env.php b/.vortex/installer/src/Utils/Env.php index 04ef345aec..ca7f972f09 100644 --- a/.vortex/installer/src/Utils/Env.php +++ b/.vortex/installer/src/Utils/Env.php @@ -33,7 +33,7 @@ public static function getFromDotenv(string $name, string $dir): ?string { } $file = $dir . '/.env'; - if (!is_readable($file)) { + if (!File::isReadable($file)) { return NULL; } @@ -82,7 +82,7 @@ public static function putFromDotenv(string $filename = '.env', bool $override_e * Array of parsed values, key is the variable name. */ public static function parseDotenv(string $filename = '.env'): array { - if (!is_file($filename) || !is_readable($filename)) { + if (!File::isReadable($filename)) { return []; } @@ -140,7 +140,7 @@ public static function parseDotenv(string $filename = '.env'): array { * Array of parsed values after modification. */ public static function writeValueDotenv(string $name, ?string $value = NULL, string $filename = '.env', bool $enabled = TRUE): array { - if (!is_readable($filename)) { + if (!File::isReadable($filename)) { throw new \RuntimeException(sprintf('File "%s" is not readable.', $filename)); } diff --git a/.vortex/installer/src/Utils/File.php b/.vortex/installer/src/Utils/File.php index 37dfd7d1bc..5060b26afe 100644 --- a/.vortex/installer/src/Utils/File.php +++ b/.vortex/installer/src/Utils/File.php @@ -30,6 +30,16 @@ public static function isInternal(string $path): bool { return in_array($path, self::internalPaths()); } + /** + * Check if path is a regular file with readable contents. + * + * Distinct from exists(), which is also TRUE for a directory: this answers + * whether the path can be passed to read(). + */ + public static function isReadable(string $path): bool { + return is_file($path) && is_readable($path); + } + /** * Get list of internal paths. */ diff --git a/.vortex/installer/src/Utils/FileManager.php b/.vortex/installer/src/Utils/FileManager.php index 7fea04713e..074007df39 100644 --- a/.vortex/installer/src/Utils/FileManager.php +++ b/.vortex/installer/src/Utils/FileManager.php @@ -150,7 +150,7 @@ public function prepareDestination(): array { $messages[] = sprintf('Created directory "%s".', $destination); } - if (!is_readable($destination . '/.git')) { + if (!File::exists($destination . '/.git')) { $messages[] = sprintf('Initializing a new Git repository in directory "%s".', $destination); // The destination arrives from a CLI option, the environment or a config @@ -199,7 +199,7 @@ public function copyFiles(): void { } foreach ($ignored_files as $ignored_file) { - if (is_readable($ignored_file)) { + if (File::exists($ignored_file)) { File::remove($ignored_file); } } @@ -214,7 +214,7 @@ public function copyFiles(): void { File::copy($src, $destination); } - if (!file_exists($destination . '/.env.local') && file_exists($destination . '/.env.local.example')) { + if (!File::exists($destination . '/.env.local') && File::exists($destination . '/.env.local.example')) { File::copy($destination . '/.env.local.example', $destination . '/.env.local'); } @@ -255,7 +255,7 @@ protected function removeExcludedPaths(array $paths, array $expected): void { $target = $destination . '/' . $path; - if (!is_file($target)) { + if (!File::isReadable($target)) { continue; } @@ -302,7 +302,7 @@ protected function recordReplacedChanges(string $src): void { foreach ($this->relativePaths($src) as $path) { $project = $destination . '/' . $path; - if (!is_file($project)) { + if (!File::isReadable($project)) { continue; } @@ -319,7 +319,7 @@ protected function recordReplacedChanges(string $src): void { // diff the project's copy against. $previous = $this->previousDir . '/' . $path; - $registry->add($path, is_file($previous) ? File::read($previous) : NULL, File::read($project), File::read($next)); + $registry->add($path, File::isReadable($previous) ? File::read($previous) : NULL, File::read($project), File::read($next)); } $this->registryFile = $registry->write((string) $this->previousRef, (string) $this->config->get(Config::VERSION), date('Y-m-d H:i:s')); @@ -360,7 +360,7 @@ protected function hashDirectory(string $directory): array { foreach ($this->relativePaths($directory) as $path) { $file = $directory . '/' . $path; - if (is_file($file)) { + if (File::isReadable($file)) { $hashes[$path] = (string) hash_file(self::HASH_ALGO, $file); } } @@ -411,7 +411,7 @@ public function removeObsoletePaths(): void { foreach ($obsolete as $relative) { $path = $destination . '/' . $relative; - if (file_exists($path)) { + if (File::exists($path)) { File::remove($path); } } @@ -445,12 +445,12 @@ public function prepareDemo(Downloader $downloader): array|string { $data_dir = $this->config->getDestination() . '/' . Env::get('VORTEX_DB_DIR', './.data'); $db_file = Env::get('VORTEX_DB_FILE', 'db.sql'); - if (file_exists($data_dir . '/' . $db_file)) { + if (File::exists($data_dir . '/' . $db_file)) { return 'Database dump file already exists. Skipping demo database fetch.'; } $messages = []; - if (!file_exists($data_dir)) { + if (!File::exists($data_dir)) { $data_dir = File::mkdir($data_dir); $messages[] = sprintf('Created data directory "%s".', $data_dir); } diff --git a/.vortex/installer/src/Utils/JsonManipulator.php b/.vortex/installer/src/Utils/JsonManipulator.php index 78bfab75fe..eeaaf86af3 100644 --- a/.vortex/installer/src/Utils/JsonManipulator.php +++ b/.vortex/installer/src/Utils/JsonManipulator.php @@ -14,7 +14,7 @@ public function __construct(protected string $contents) { } public static function fromFile(string $composer_json): ?self { - if (!is_readable($composer_json) || !is_file($composer_json)) { + if (!File::isReadable($composer_json)) { return NULL; } diff --git a/.vortex/installer/src/Utils/NpmLock.php b/.vortex/installer/src/Utils/NpmLock.php index 15bfd6ac80..eaf92e2a5c 100644 --- a/.vortex/installer/src/Utils/NpmLock.php +++ b/.vortex/installer/src/Utils/NpmLock.php @@ -41,7 +41,7 @@ class NpmLock { public static function sync(string $manifest_file): void { $lock_file = dirname($manifest_file) . DIRECTORY_SEPARATOR . self::FILE; - if (!is_file($lock_file)) { + if (!File::isReadable($lock_file)) { return; } diff --git a/.vortex/installer/src/Utils/OptionsResolver.php b/.vortex/installer/src/Utils/OptionsResolver.php index f82393c589..5de498a3e7 100644 --- a/.vortex/installer/src/Utils/OptionsResolver.php +++ b/.vortex/installer/src/Utils/OptionsResolver.php @@ -54,7 +54,7 @@ public static function resolve(array $options): array { $config_json = '{}'; if (isset($options['config']) && is_scalar($options['config'])) { $config_candidate = (string) $options['config']; - $config_json = is_file($config_candidate) ? (string) file_get_contents($config_candidate) : $config_candidate; + $config_json = File::isReadable($config_candidate) ? File::read($config_candidate) : $config_candidate; } $config = Config::fromString($config_json); @@ -102,7 +102,7 @@ public static function resolve(array $options): array { throw new \RuntimeException(sprintf('Invalid repository URI: %s.', $e->getMessage()), $e->getCode(), $e); } - $config->set(Config::IS_VORTEX_PROJECT, File::contains($config->getDestination() . '/README.md', '/badge\/Vortex-/')); + $config->set(Config::IS_VORTEX_PROJECT, File::contains($config->getDestination() . '/README.md', Version::BADGE_REGEX)); // Flag to proceed with installation. If FALSE, the installation only // prints the resolved values and does not proceed. @@ -118,11 +118,11 @@ public static function resolve(array $options): array { if (isset($options['prompts']) && is_scalar($options['prompts'])) { $prompts_candidate = (string) $options['prompts']; - if (is_file($prompts_candidate)) { - if (!is_readable($prompts_candidate)) { + if (File::exists($prompts_candidate)) { + if (!File::isReadable($prompts_candidate)) { throw new \RuntimeException(sprintf('Unable to read --prompts file: "%s".', $prompts_candidate)); } - $prompts_json = (string) file_get_contents($prompts_candidate); + $prompts_json = File::read($prompts_candidate); } else { $prompts_json = $prompts_candidate; diff --git a/.vortex/installer/src/Utils/Tui.php b/.vortex/installer/src/Utils/Tui.php index afbfaf29d2..76fc5adf42 100644 --- a/.vortex/installer/src/Utils/Tui.php +++ b/.vortex/installer/src/Utils/Tui.php @@ -156,7 +156,7 @@ public static function caretUp(): string { public static function caretEol(string $text): string { $lines = explode(PHP_EOL, $text); - $longest = max(array_map(strlen(...), $lines)); + $longest = max(array_map(Strings::strlenPlain(...), $lines)); return "\033[" . $longest . "C"; } diff --git a/.vortex/installer/src/Utils/UpdateRegistry.php b/.vortex/installer/src/Utils/UpdateRegistry.php index 517b387b50..e189372a15 100644 --- a/.vortex/installer/src/Utils/UpdateRegistry.php +++ b/.vortex/installer/src/Utils/UpdateRegistry.php @@ -98,7 +98,7 @@ public function write(string $from, string $to, string $time): ?string { } $file = $this->destination . '/' . self::FILE; - $existing = is_file($file) ? File::read($file) : self::HEADING . PHP_EOL; + $existing = File::isReadable($file) ? File::read($file) : self::HEADING . PHP_EOL; File::dump($file, $existing . $content); diff --git a/.vortex/installer/src/Utils/Version.php b/.vortex/installer/src/Utils/Version.php index 0e17bbfdfe..e2916cf08d 100644 --- a/.vortex/installer/src/Utils/Version.php +++ b/.vortex/installer/src/Utils/Version.php @@ -15,6 +15,14 @@ */ class Version { + /** + * Pattern matching the Vortex badge in a project README. + * + * The capture group holds the git reference the badge was stamped with, so + * a README that matches is one a reference can be read from. + */ + const BADGE_REGEX = '#badge/Vortex-(.+?)-65ACBC\.svg#'; + /** * Extract the major version number from a version string. * @@ -85,13 +93,13 @@ public static function majorFromConstraint(?string $constraint): ?int { public static function detectProjectRef(string $dir): ?string { $readme = $dir . '/README.md'; - if (!is_file($readme)) { + if (!File::isReadable($readme)) { return NULL; } - $contents = (string) file_get_contents($readme); + $contents = File::read($readme); - if (!preg_match('#badge/Vortex-(.+?)-65ACBC\.svg#', $contents, $matches)) { + if (!preg_match(self::BADGE_REGEX, $contents, $matches)) { return NULL; } @@ -117,11 +125,11 @@ public static function detectProjectRef(string $dir): ?string { public static function detectProjectMajor(string $dir): ?int { $composer_json = $dir . '/composer.json'; - if (!is_file($composer_json)) { + if (!File::isReadable($composer_json)) { return NULL; } - $data = json_decode((string) file_get_contents($composer_json), TRUE); + $data = json_decode(File::read($composer_json), TRUE); if (!is_array($data)) { return NULL; } diff --git a/.vortex/installer/src/Utils/Yaml.php b/.vortex/installer/src/Utils/Yaml.php index 3d69acf12e..ad32622091 100644 --- a/.vortex/installer/src/Utils/Yaml.php +++ b/.vortex/installer/src/Utils/Yaml.php @@ -10,7 +10,7 @@ class Yaml extends SymfonyYaml { public static function validateFile(string $path): void { - if (!file_exists($path) || !is_readable($path)) { + if (!File::isReadable($path)) { throw new \RuntimeException(sprintf('File does not exist or is not readable: "%s".', $path)); } diff --git a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php index 9aae68f9e5..136f1ea131 100644 --- a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php +++ b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php @@ -469,129 +469,164 @@ public function testDownloadArchiveWithGithubToken(): void { $this->assertEquals('develop', $version); } - public function testValidateRemoteRepositoryExistsWithNotFoundError(): void { - $mock_http_client = $this->createMock(ClientInterface::class); - $mock_response = $this->createMock(ResponseInterface::class); - $mock_response->method('getStatusCode')->willReturn(404); - $mock_http_client->method('request')->willReturn($mock_response); - $destination = self::$tmp . '/destination_' . uniqid(); - File::mkdir($destination); - $downloader = new RepositoryDownloader($mock_http_client); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('Repository not found or not accessible: "https://github.com/user/nonexistent" (HTTP 404)'); - $downloader->download(Artifact::create('https://github.com/user/nonexistent', '1.0.0'), $destination); - } + /** + * @param \Closure(self):array{0:?\GuzzleHttp\ClientInterface,1:string} $setup + * Builds the HTTP client (NULL for a local repository) and the repository + * to download from. + */ + #[DataProvider('dataProviderValidateFailure')] + public function testValidateFailure(\Closure $setup, string $ref, string $expected_message): void { + [$http_client, $repo] = $setup($this); - public function testValidateRemoteRefExistsWithNotFoundError(): void { - $mock_http_client = $this->createMock(ClientInterface::class); - $repo_response = $this->createMock(ResponseInterface::class); - $repo_response->method('getStatusCode')->willReturn(200); - $ref_response = $this->createMock(ResponseInterface::class); - $ref_response->method('getStatusCode')->willReturn(404); - $mock_http_client->method('request')->willReturnCallback(function ($method, $url) use ($repo_response, $ref_response): ResponseInterface { - if (str_contains($url, '/archive/')) { - return $ref_response; - } - return $repo_response; - }); $destination = self::$tmp . '/destination_' . uniqid(); File::mkdir($destination); - $downloader = new RepositoryDownloader($mock_http_client); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('Reference "nonexistent-tag" not found in repository "https://github.com/user/repo"'); - $downloader->download(Artifact::create('https://github.com/user/repo', 'nonexistent-tag'), $destination); - } - public function testValidateLocalRepositoryExistsWithNonexistentPath(): void { - $nonexistent_path = self::$tmp . '/nonexistent_repo_' . uniqid(); - $destination = self::$tmp . '/destination_' . uniqid(); - File::mkdir($destination); - $downloader = new RepositoryDownloader(); + $downloader = new RepositoryDownloader($http_client); + $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage(sprintf('Local repository path does not exist: "%s"', $nonexistent_path)); - $downloader->download(Artifact::create($nonexistent_path, 'main'), $destination); + $this->expectExceptionMessage($expected_message); + + $downloader->download(Artifact::create($repo, $ref), $destination); } - public function testValidateLocalRepositoryExistsWithNonGitDirectory(): void { - $non_git_path = self::$tmp . '/non_git_dir_' . uniqid(); - File::mkdir($non_git_path); - $destination = self::$tmp . '/destination_' . uniqid(); - File::mkdir($destination); - $downloader = new RepositoryDownloader(); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage(sprintf('Path is not a git repository: "%s"', $non_git_path)); - $downloader->download(Artifact::create($non_git_path, 'main'), $destination); + public static function dataProviderValidateFailure(): \Iterator { + yield 'remote repository not found' => [ + static fn(self $test): array => [$test->stubStatusClient(404), 'https://github.com/user/nonexistent'], + '1.0.0', + 'Repository not found or not accessible: "https://github.com/user/nonexistent" (HTTP 404)', + ]; + + yield 'remote ref not found' => [ + static fn(self $test): array => [$test->stubRefClient(404), 'https://github.com/user/repo'], + 'nonexistent-tag', + 'Reference "nonexistent-tag" not found in repository "https://github.com/user/repo"', + ]; + + yield 'remote repository unreachable' => [ + static fn(self $test): array => [$test->stubThrowingClient('Connection timeout'), 'https://github.com/user/repo'], + '1.0.0', + 'Unable to access repository "https://github.com/user/repo": Connection timeout.', + ]; + + yield 'remote ref unverifiable' => [ + static fn(self $test): array => [$test->stubRefClient(NULL, 'Network error'), 'https://github.com/user/repo'], + 'test-tag', + 'Unable to verify reference "test-tag" in repository "https://github.com/user/repo": Network error.', + ]; + + yield 'local path missing' => [ + static function (self $test): array { + $path = self::$tmp . '/nonexistent_repo_' . uniqid(); + + return [NULL, $path]; + }, + 'main', + 'Local repository path does not exist: ', + ]; + + yield 'local path not a git repository' => [ + static function (self $test): array { + $path = self::$tmp . '/non_git_dir_' . uniqid(); + File::mkdir($path); + + return [NULL, $path]; + }, + 'main', + 'Path is not a git repository: ', + ]; } - public function testValidateRemoteRepositoryExistsWithRequestException(): void { - $mock_http_client = $this->createMock(ClientInterface::class); - $mock_http_client->method('request')->willThrowException(new RequestException('Connection timeout', $this->createMock(RequestInterface::class))); - $destination = self::$tmp . '/destination_' . uniqid(); - File::mkdir($destination); - $downloader = new RepositoryDownloader($mock_http_client); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('Unable to access repository "https://github.com/user/repo": Connection timeout.'); - $downloader->download(Artifact::create('https://github.com/user/repo', '1.0.0'), $destination); + /** + * Stub a client answering every request with a single status code. + */ + protected function stubStatusClient(int $status_code): ClientInterface { + $client = $this->createMock(ClientInterface::class); + $response = $this->createMock(ResponseInterface::class); + $response->method('getStatusCode')->willReturn($status_code); + $client->method('request')->willReturn($response); + + return $client; } - public function testValidateRemoteRefExistsWithRequestException(): void { - $mock_http_client = $this->createMock(ClientInterface::class); + /** + * Stub a client where the repository resolves and the archive request fails. + * + * @param int|null $status_code + * Status code for the archive request, or NULL to throw instead. + * @param string|null $exception_message + * Message for the thrown request exception when no status code is given. + */ + protected function stubRefClient(?int $status_code, ?string $exception_message = NULL): ClientInterface { + $client = $this->createMock(ClientInterface::class); $repo_response = $this->createMock(ResponseInterface::class); $repo_response->method('getStatusCode')->willReturn(200); - $mock_http_client->method('request')->willReturnCallback(function ($method, $url) use ($repo_response): ResponseInterface { - if (str_contains($url, '/archive/')) { - throw new RequestException('Network error', $this->createMock(RequestInterface::class)); + + $ref_response = NULL; + if ($status_code !== NULL) { + $ref_response = $this->createMock(ResponseInterface::class); + $ref_response->method('getStatusCode')->willReturn($status_code); + } + + $request = $this->createMock(RequestInterface::class); + $client->method('request')->willReturnCallback(function ($method, $url) use ($repo_response, $ref_response, $exception_message, $request): ResponseInterface { + if (!str_contains($url, '/archive/')) { + return $repo_response; + } + + if (!$ref_response instanceof ResponseInterface) { + throw new RequestException((string) $exception_message, $request); } - return $repo_response; + + return $ref_response; }); - $destination = self::$tmp . '/destination_' . uniqid(); - File::mkdir($destination); - $downloader = new RepositoryDownloader($mock_http_client); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('Unable to verify reference "test-tag" in repository "https://github.com/user/repo": Network error.'); - $downloader->download(Artifact::create('https://github.com/user/repo', 'test-tag'), $destination); + + return $client; } - public function testValidateRemoteArtifactWithStableRef(): void { - $mock_http_client = $this->createMock(ClientInterface::class); - $mock_response = $this->createMock(ResponseInterface::class); - $mock_response->method('getStatusCode')->willReturn(200); - $mock_http_client->method('request')->willReturn($mock_response); - $downloader = new RepositoryDownloader($mock_http_client); - $artifact = Artifact::create('https://github.com/user/repo', 'stable'); - $downloader->validate($artifact); - $this->expectNotToPerformAssertions(); + /** + * Stub a client that fails every request with a transport error. + */ + protected function stubThrowingClient(string $message): ClientInterface { + $client = $this->createMock(ClientInterface::class); + $client->method('request')->willThrowException(new RequestException($message, $this->createMock(RequestInterface::class))); + + return $client; } - public function testValidateRemoteArtifactWithCustomRef(): void { + #[DataProvider('dataProviderValidateRemoteArtifact')] + public function testValidateRemoteArtifact(string $ref): void { $mock_http_client = $this->createMock(ClientInterface::class); $mock_response = $this->createMock(ResponseInterface::class); $mock_response->method('getStatusCode')->willReturn(200); $mock_http_client->method('request')->willReturn($mock_response); $downloader = new RepositoryDownloader($mock_http_client); - $artifact = Artifact::create('https://github.com/user/repo', 'v1.0.0'); - $downloader->validate($artifact); + + $downloader->validate(Artifact::create('https://github.com/user/repo', $ref)); + $this->expectNotToPerformAssertions(); } - public function testValidateLocalArtifactWithHeadRef(): void { - $temp_repo_dir = $this->createGitRepo(); - $downloader = new RepositoryDownloader(); - $artifact = Artifact::create($temp_repo_dir, 'HEAD'); - $downloader->validate($artifact); - $this->expectNotToPerformAssertions(); - $this->removeGitRepo($temp_repo_dir); + public static function dataProviderValidateRemoteArtifact(): \Iterator { + yield 'stable ref' => ['stable']; + yield 'custom ref' => ['v1.0.0']; } - public function testValidateLocalArtifactWithCustomRef(): void { + #[DataProvider('dataProviderValidateLocalArtifact')] + public function testValidateLocalArtifact(string $ref): void { $temp_repo_dir = $this->createGitRepo(); $downloader = new RepositoryDownloader(); - $artifact = Artifact::create($temp_repo_dir, 'main'); - $downloader->validate($artifact); + + $downloader->validate(Artifact::create($temp_repo_dir, $ref)); + $this->expectNotToPerformAssertions(); $this->removeGitRepo($temp_repo_dir); } + public static function dataProviderValidateLocalArtifact(): \Iterator { + yield 'HEAD ref' => ['HEAD']; + yield 'custom ref' => ['main']; + } + protected function createMockHttpClient(int $status_code = 200, string $body_content = 'mock content'): ClientInterface { $mock_client = $this->createMock(ClientInterface::class); $mock_response = $this->createMock(ResponseInterface::class); diff --git a/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php b/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php index dfb8b285d8..d0a0bc0d45 100644 --- a/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php +++ b/.vortex/installer/tests/Unit/Prompts/InstallerPresenterTest.php @@ -32,14 +32,14 @@ protected function setUp(): void { } public function testConstructor(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $this->assertInstanceOf(InstallerPresenter::class, $presenter); } public function testSetPromptManager(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -51,7 +51,7 @@ public function testSetPromptManager(): void { #[DataProvider('dataProviderHeaderWithStableArtifact')] public function testHeaderWithStableArtifact(bool $is_vortex_project, bool $no_interaction): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->set(Config::IS_VORTEX_PROJECT, $is_vortex_project); $config->setNoInteraction($no_interaction); $presenter = new InstallerPresenter($config); @@ -73,7 +73,7 @@ public static function dataProviderHeaderWithStableArtifact(): \Iterator { } public function testHeaderWithDevelopmentArtifact(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $artifact = Artifact::fromUri(RepositoryDownloader::DEFAULT_REPO . '#' . RepositoryDownloader::REF_HEAD); @@ -84,7 +84,7 @@ public function testHeaderWithDevelopmentArtifact(): void { } public function testHeaderWithCustomArtifact(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $artifact = Artifact::fromUri('https://github.com/drevops/vortex.git#abc123'); @@ -96,7 +96,7 @@ public function testHeaderWithCustomArtifact(): void { } public function testHeaderVersionPlaceholderReplacement(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $artifact = Artifact::fromUri(NULL); @@ -108,7 +108,7 @@ public function testHeaderVersionPlaceholderReplacement(): void { } public function testHeaderInteractiveShowsControls(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->setNoInteraction(FALSE); $presenter = new InstallerPresenter($config); @@ -121,7 +121,7 @@ public function testHeaderInteractiveShowsControls(): void { } public function testHeaderNonInteractiveHidesControls(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->setNoInteraction(TRUE); $presenter = new InstallerPresenter($config); @@ -135,7 +135,7 @@ public function testHeaderNonInteractiveHidesControls(): void { } public function testHeaderExistingVortexProject(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->set(Config::IS_VORTEX_PROJECT, TRUE); $presenter = new InstallerPresenter($config); @@ -147,7 +147,7 @@ public function testHeaderExistingVortexProject(): void { } public function testFooterNewProject(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->set(Config::IS_VORTEX_PROJECT, FALSE); $presenter = new InstallerPresenter($config); @@ -160,7 +160,7 @@ public function testFooterNewProject(): void { } public function testFooterExistingProject(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $config->set(Config::IS_VORTEX_PROJECT, TRUE); $presenter = new InstallerPresenter($config); @@ -173,7 +173,7 @@ public function testFooterExistingProject(): void { } public function testFooterBuildSucceeded(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -191,7 +191,7 @@ public function testFooterBuildSucceeded(): void { } public function testFooterBuildSucceededWithHandlerOutput(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -208,7 +208,7 @@ public function testFooterBuildSucceededWithHandlerOutput(): void { #[DataProvider('dataProviderFooterBuildSkipped')] public function testFooterBuildSkipped(string $starter, bool $expect_profile_command, bool $expect_export_db): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -258,7 +258,7 @@ public static function dataProviderFooterBuildSkipped(): \Iterator { } public function testFooterBuildSkippedDefaultsToDemo(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -274,7 +274,7 @@ public function testFooterBuildSkippedDefaultsToDemo(): void { } public function testFooterBuildFailed(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -295,7 +295,7 @@ public function testFooterBuildFailed(): void { } public function testFooterBuildFailedWithHandlerOutput(): void { - $config = new Config('/tmp/root', '/tmp/dst', '/tmp/tmp'); + $config = $this->createConfig(); $presenter = new InstallerPresenter($config); $mock_pm = $this->createMock(PromptManager::class); @@ -321,4 +321,11 @@ public static function dataProviderBuildResultConstants(): \Iterator { yield 'failed' => [InstallerPresenter::BUILD_RESULT_FAILED, 'failed']; } + /** + * Create a config with paths the presenter never reads from disk. + */ + protected function createConfig(): Config { + return new Config(static::$tmp . '/root', static::$tmp . '/dst', static::$tmp . '/tmp'); + } + } diff --git a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php index 43faef8231..fa68c36acf 100644 --- a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php +++ b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php @@ -13,6 +13,7 @@ use DrevOps\VortexInstaller\Utils\FileManager; use DrevOps\VortexInstaller\Utils\UpdateRegistry; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; #[CoversClass(FileManager::class)] class FileManagerTest extends UnitTestCase { @@ -25,61 +26,49 @@ protected function setUp(): void { static::envUnsetPrefix('VORTEX_DB'); } - public function testConstructor(): void { - $config = new Config('/tmp/root', self::$sut, '/tmp/tmp'); - $fm = new FileManager($config); - - $this->assertInstanceOf(FileManager::class, $fm); + /** + * Create a config for a destination, staging from a source when given. + */ + protected function createConfig(string $destination, ?string $src = NULL): Config { + return new Config(static::$tmp . '/root', $destination, $src ?? static::$tmp . '/staged'); } - public function testPrepareDestinationExistingDirWithGit(): void { - $destination = self::$sut; - mkdir($destination . '/.git', 0777, TRUE); - - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); + public function testConstructor(): void { + $config = $this->createConfig(self::$sut); $fm = new FileManager($config); - $messages = $fm->prepareDestination(); - - $this->assertEmpty($messages); + $this->assertInstanceOf(FileManager::class, $fm); } - public function testPrepareDestinationExistingDirWithoutGit(): void { - $destination = self::$sut; - - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); - $fm = new FileManager($config); - - $messages = $fm->prepareDestination(); - - $this->assertNotEmpty($messages); - $this->assertDirectoryExists($destination . '/.git'); - $this->assertStringContainsString('Initializing a new Git repository', $messages[0]); - } + /** + * @param array $expected_messages + * Substrings every returned message set must contain. + */ + #[DataProvider('dataProviderPrepareDestination')] + public function testPrepareDestination(string $subdir, bool $with_git, array $expected_messages): void { + $destination = self::$sut . $subdir; - public function testPrepareDestinationCreatesNewDir(): void { - $destination = self::$sut . '/new_subdir'; + if ($with_git) { + File::mkdir($destination . '/.git'); + } - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); - $fm = new FileManager($config); + $fm = new FileManager($this->createConfig($destination)); $messages = $fm->prepareDestination(); $this->assertDirectoryExists($destination); $this->assertDirectoryExists($destination . '/.git'); + $this->assertCount(count($expected_messages), $messages); - $has_created_msg = FALSE; - $has_git_msg = FALSE; - foreach ($messages as $message) { - if (str_contains($message, 'Created directory')) { - $has_created_msg = TRUE; - } - if (str_contains($message, 'Initializing a new Git repository')) { - $has_git_msg = TRUE; - } + foreach ($expected_messages as $index => $expected_message) { + $this->assertStringContainsString($expected_message, $messages[$index]); } - $this->assertTrue($has_created_msg); - $this->assertTrue($has_git_msg); + } + + public static function dataProviderPrepareDestination(): \Iterator { + yield 'existing directory with a repository' => ['', TRUE, []]; + yield 'existing directory without a repository' => ['', FALSE, ['Initializing a new Git repository']]; + yield 'directory created by the install' => ['/new_subdir', FALSE, ['Created directory', 'Initializing a new Git repository']]; } public function testCopyFilesCopiesToDestination(): void { @@ -89,7 +78,7 @@ public function testCopyFilesCopiesToDestination(): void { mkdir($destination, 0777, TRUE); file_put_contents($src . '/test.txt', 'content'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); @@ -105,7 +94,7 @@ public function testCopyFilesCreatesEnvLocal(): void { mkdir($destination, 0777, TRUE); file_put_contents($src . '/test.txt', 'content'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); @@ -132,7 +121,7 @@ public function testCopyFilesSkipsEnvLocalIfExists(): void { file_put_contents($destination . '/.env.local', 'EXISTING=1'); file_put_contents($destination . '/.env.local.example', 'EXAMPLE=1'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); @@ -146,7 +135,7 @@ public function testCopyFilesHandlesEmptySrc(): void { mkdir($src, 0777, TRUE); mkdir($destination, 0777, TRUE); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); @@ -161,7 +150,7 @@ public function testCopyFilesRemovesUnmodifiedExcludedPaths(): void { file_put_contents($src . '/phpstan.neon', 'parameters: []'); file_put_contents(File::mkdir($src . '/.circleci') . '/config.yml', 'version: 2.1'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -193,7 +182,7 @@ public function testCopyFilesKeepsModifiedExcludedPaths(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents($src . '/phpstan.neon', 'parameters: []'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -216,7 +205,7 @@ public function testCopyFilesKeepsExcludedPathsWithoutRecordedHash(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents($src . '/phpstan.neon', 'parameters: []'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); $fm->snapshotTemplate(); @@ -236,7 +225,7 @@ public function testCopyFilesWritesNoManifest(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents(File::mkdir($src . '/scripts') . '/provision.sh', 'echo 1'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->snapshotTemplate(); @@ -251,7 +240,7 @@ public function testCopyFilesRemovesExcludedPathsMatchedOnlyAfterRendering(): vo file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents($src . '/rector.php', 'paths: your_site'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -275,7 +264,7 @@ public function testCopyFilesRemovesExcludedPathsDeselectedByThisRun(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents($src . '/jest.config.js', 'module.exports = {};'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -298,7 +287,7 @@ public function testCopyFilesRecordsReplacedProjectChanges(): void { $destination = self::$sut . '/dst_registry'; file_put_contents(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $config->set(Config::VERSION, '1.41.0', TRUE); $fm = new FileManager($config); @@ -326,7 +315,7 @@ public function testCopyFilesRecordsNothingWithoutProjectChanges(): void { $destination = self::$sut . '/dst_no_registry'; file_put_contents(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -345,7 +334,7 @@ public function testCopyFilesRemovesCommittedManifest(): void { $destination = self::$sut . '/dst_stale_manifest'; file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); @@ -361,7 +350,7 @@ public function testCopyFilesKeepsManifestInDestinationThatIsNotVortexProject(): $destination = self::$sut . '/dst_foreign_manifest'; file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); file_put_contents(File::mkdir($destination) . '/.vortex-manifest.json', '{"owned":"by the project"}'); @@ -376,7 +365,7 @@ public function testCopyFilesKeepsPathsTheTemplateNeverShipped(): void { $destination = self::$sut . '/dst_unknown'; file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); $fm->snapshotTemplate(); @@ -396,7 +385,7 @@ public function testCopyFilesKeepsExcludedPathsForNonVortexProject(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents($src . '/phpstan.neon', 'parameters: []'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->snapshotTemplate(); @@ -414,7 +403,7 @@ public function testCopyFilesKeepsHarnessPaths(): void { file_put_contents(File::mkdir($src) . '/composer.json', '{}'); file_put_contents(File::mkdir($src . '/.vortex') . '/CLAUDE.md', 'harness'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); $fm->snapshotTemplate(); @@ -439,7 +428,7 @@ public function testCopyFilesRemovesObsoleteScriptsVortex(): void { file_put_contents($destination . '/scripts/vortex/legacy.sh', 'legacy'); file_put_contents($destination . '/scripts/keep.sh', 'custom'); - $config = new Config('/tmp/root', $destination, $src); + $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); @@ -453,7 +442,7 @@ public function testRemoveObsoletePathsSilentOnMissing(): void { $destination = self::$sut . '/dst_no_obsolete'; mkdir($destination, 0777, TRUE); - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); + $config = $this->createConfig($destination); $fm = new FileManager($config); $fm->removeObsoletePaths(); @@ -461,110 +450,61 @@ public function testRemoveObsoletePathsSilentOnMissing(): void { $this->addToAssertionCount(1); } - public function testPrepareDemoNotDemoMode(): void { - $config = new Config('/tmp/root', self::$sut, '/tmp/tmp'); - $fm = new FileManager($config); - - $downloader = $this->createMock(Downloader::class); - $result = $fm->prepareDemo($downloader); - - $this->assertEquals('Not a demo mode.', $result); - } - - public function testPrepareDemoWithFetchSkip(): void { - $config = new Config('/tmp/root', self::$sut, '/tmp/tmp'); - $config->set(Config::IS_DEMO, TRUE); - $config->set(Config::IS_DEMO_DB_FETCH_SKIP, TRUE); - $fm = new FileManager($config); - - $downloader = $this->createMock(Downloader::class); - $result = $fm->prepareDemo($downloader); - - $this->assertIsString($result); - $this->assertStringContainsString('Skipping demo database fetch', $result); - } - - public function testPrepareDemoNoUrl(): void { + /** + * @param array $config_values + * Config keys to set before preparing, keyed by constant. + * @param string|null $dotenv + * Content for the project's '.env', or NULL to write none. + * @param bool $with_database_file + * Seed the data directory with an already-fetched database dump. + */ + #[DataProvider('dataProviderPrepareDemo')] + public function testPrepareDemo(array $config_values, ?string $dotenv, bool $with_database_file, string $expected_message): void { $destination = self::$sut; - file_put_contents($destination . '/.env', ''); - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); - $config->set(Config::IS_DEMO, TRUE); - $fm = new FileManager($config); + if ($dotenv !== NULL) { + File::dump($destination . '/.env', $dotenv); + } - $downloader = $this->createMock(Downloader::class); - $result = $fm->prepareDemo($downloader); + if ($with_database_file) { + File::dump(File::mkdir($destination . '/.data') . '/db.sql', 'existing'); + } - $this->assertIsString($result); - $this->assertStringContainsString('No database fetch URL provided', $result); - } + $config = $this->createConfig($destination); + foreach ($config_values as $name => $value) { + $config->set($name, $value); + } - public function testPrepareDemoExistingDatabaseFile(): void { - $destination = self::$sut; - $data_dir = $destination . '/.data'; - mkdir($data_dir, 0777, TRUE); - file_put_contents($data_dir . '/db.sql', 'existing'); - file_put_contents($destination . '/.env', "VORTEX_FETCH_DB_URL=https://example.com/db.sql\nVORTEX_DB_DIR=./.data\nVORTEX_DB_FILE=db.sql\n"); + $result = (new FileManager($config))->prepareDemo($this->createMock(Downloader::class)); - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); - $config->set(Config::IS_DEMO, TRUE); - $fm = new FileManager($config); + $messages = is_array($result) ? $result : [$result]; + $this->assertStringContainsString($expected_message, implode(PHP_EOL, array_map(strval(...), $messages))); + } - $downloader = $this->createMock(Downloader::class); - $result = $fm->prepareDemo($downloader); + public static function dataProviderPrepareDemo(): \Iterator { + $dotenv = "VORTEX_FETCH_DB_URL=https://example.com/db.sql\nVORTEX_DB_DIR=./.data\nVORTEX_DB_FILE=db.sql\n"; - $this->assertIsString($result); - $this->assertStringContainsString('already exists', $result); + yield 'not a demo' => [[], NULL, FALSE, 'Not a demo mode.']; + yield 'fetch skipped' => [[Config::IS_DEMO => TRUE, Config::IS_DEMO_DB_FETCH_SKIP => TRUE], NULL, FALSE, 'Skipping demo database fetch']; + yield 'no fetch url' => [[Config::IS_DEMO => TRUE], '', FALSE, 'No database fetch URL provided']; + yield 'database already fetched' => [[Config::IS_DEMO => TRUE], $dotenv, TRUE, 'already exists']; + yield 'data directory created' => [[Config::IS_DEMO => TRUE], $dotenv, FALSE, 'Created data directory']; + yield 'database fetched' => [[Config::IS_DEMO => TRUE], $dotenv, FALSE, 'Fetched demo database']; } - public function testPrepareDemoFetchesDatabase(): void { + public function testPrepareDemoDownloadsFromTheConfiguredUrl(): void { $destination = self::$sut; - file_put_contents($destination . '/.env', "VORTEX_FETCH_DB_URL=https://example.com/db.sql\nVORTEX_DB_DIR=./.data\nVORTEX_DB_FILE=db.sql\n"); + File::dump($destination . '/.env', "VORTEX_FETCH_DB_URL=https://example.com/db.sql\nVORTEX_DB_DIR=./.data\nVORTEX_DB_FILE=db.sql\n"); - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); + $config = $this->createConfig($destination); $config->set(Config::IS_DEMO, TRUE); - $fm = new FileManager($config); $downloader = $this->createMock(Downloader::class); $downloader->expects($this->once()) ->method('download') ->with('https://example.com/db.sql', $this->stringContains('db.sql')); - $result = $fm->prepareDemo($downloader); - - $this->assertIsArray($result); - $this->assertNotEmpty($result); - - $has_download_msg = FALSE; - foreach ($result as $msg) { - if (str_contains((string) $msg, 'Fetched demo database')) { - $has_download_msg = TRUE; - } - } - $this->assertTrue($has_download_msg); - } - - public function testPrepareDemoCreatesDataDir(): void { - $destination = self::$sut; - file_put_contents($destination . '/.env', "VORTEX_FETCH_DB_URL=https://example.com/db.sql\nVORTEX_DB_DIR=./.data\nVORTEX_DB_FILE=db.sql\n"); - - $config = new Config('/tmp/root', $destination, '/tmp/tmp'); - $config->set(Config::IS_DEMO, TRUE); - $fm = new FileManager($config); - - $downloader = $this->createMock(Downloader::class); - $result = $fm->prepareDemo($downloader); - - $this->assertIsArray($result); - $this->assertDirectoryExists($destination . '/.data'); - - $has_created_msg = FALSE; - foreach ($result as $msg) { - if (str_contains((string) $msg, 'Created data directory')) { - $has_created_msg = TRUE; - } - } - $this->assertTrue($has_created_msg); + (new FileManager($config))->prepareDemo($downloader); } /** From 526ae5266c134f6e8f6bc174ed4a9aa54d904b3b Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 11:50:07 +1000 Subject: [PATCH 02/12] [#3115] Declared the shared expected settings once in 'EnvironmentSettingsTest'. Fourteen tests each restated the same ~50-line expected array, so the installer fences inside it were maintained in fourteen places. 'expectedSettings()' holds the shared block and each test now states only the entries its environment changes, taking the file from 1840 to 1181 lines. --- .../Drupal/EnvironmentSettingsTest.php | 845 ++---------------- 1 file changed, 93 insertions(+), 752 deletions(-) diff --git a/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 127c2b8e62..3fcccb9c0a 100644 --- a/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -333,54 +333,7 @@ public function testEnvironmentNoOverrides(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; + $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); $this->assertSettings($settings); } @@ -451,54 +404,13 @@ public function testEnvironmentOverrides(): void { $this->assertConfig($config); // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; + $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 $settings['file_public_path'] = 'custom_public'; $settings['file_private_path'] = 'custom_private'; $settings['file_temp_path'] = 'custom_temp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; $settings['hash_salt'] = 'custom_hash_salt'; $settings['maintenance_theme'] = 'custom_theme'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -533,55 +445,8 @@ public function testEnvironmentLocal(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); $settings['skip_permissions_hardening'] = TRUE; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -617,55 +482,11 @@ public function testEnvironmentLocalContainer(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); $settings['skip_permissions_hardening'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', - '^example\-site\.docker\.amazee\.io$', + '^example\\-site\\.docker\\.amazee\\.io$', '^nginx$', ]; @@ -745,55 +566,8 @@ public function testEnvironmentCircleCi(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_CI; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); $settings['skip_permissions_hardening'] = TRUE; - $settings['config_sync_directory'] = '../config/default'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -831,55 +605,8 @@ public function testEnvironmentGha(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_CI; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); $settings['skip_permissions_hardening'] = TRUE; - $settings['config_sync_directory'] = '../config/default'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -913,54 +640,8 @@ public function testEnvironmentAcquiaDynamic(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -992,54 +673,8 @@ public function testEnvironmentAcquiaDev(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -1071,54 +706,8 @@ public function testEnvironmentAcquiaStage(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_STAGE; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -1147,54 +736,8 @@ public function testEnvironmentAcquiaProd(): void { $config['system.performance']['js']['preprocess'] = TRUE; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_PROD; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -1227,54 +770,9 @@ public function testEnvironmentAcquiaConfigPathOverride(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; $settings['config_sync_directory'] = 'custom_acquia_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -1314,55 +812,10 @@ public function testEnvironmentAcquiaConfigVcsDirectoryFallback(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -1486,59 +939,15 @@ public function testEnvironmentLagoonPreview(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['cache_prefix']['default'] = 'test_project_test_branch'; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\-php$', - '^.+\.amazee\.io$', - '^example1\.com$', + '^nginx\\-php$', + '^.+\\.amazee\\.io$', + '^example1\\.com$', '^example2$', ]; @@ -1576,59 +985,15 @@ public function testEnvironmentLagoonDev(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['cache_prefix']['default'] = 'test_project_develop'; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_DEV; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\-php$', - '^.+\.amazee\.io$', - '^example1\.com$', + '^nginx\\-php$', + '^.+\\.amazee\\.io$', + '^example1\\.com$', '^example2$', ]; @@ -1666,59 +1031,15 @@ public function testEnvironmentLagoonTest(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); $settings['cache_prefix']['default'] = 'test_project_master'; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_STAGE; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\-php$', - '^.+\.amazee\.io$', - '^example1\.com$', + '^nginx\\-php$', + '^.+\\.amazee\\.io$', + '^example1\\.com$', '^example2$', ]; @@ -1754,59 +1075,15 @@ public function testEnvironmentLagoonProd(): void { $config['system.performance']['js']['preprocess'] = TRUE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); $settings['cache_prefix']['default'] = 'test_project_production'; - $settings['config_exclude_modules'] = [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_PROD; - // phpcs:ignore #;< MODULE_FAST_404 - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - // phpcs:ignore #;> MODULE_FAST_404 - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\-php$', - '^.+\.amazee\.io$', - '^example1\.com$', + '^nginx\\-php$', + '^.+\\.amazee\\.io$', + '^example1\\.com$', '^example2$', ]; @@ -1837,4 +1114,68 @@ public function testEnvironmentLagoonSchemelessRoutes(): void { } // phpcs:ignore #;> SETTINGS_PROVIDER_LAGOON + /** + * Settings that every environment produces. + * + * Each test overrides only the entries its environment changes. + * + * @param string $environment + * The environment type the settings are expected to report. + * + * @return array + * Array of expected settings. + */ + protected function expectedSettings(string $environment): array { + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], + 'entity_update_batch_size' => 50, + 'environment' => $environment, + // phpcs:ignore #;< MODULE_FAST_404 + 'fast404_allow_anon_imagecache' => FALSE, + 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', + 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', + 'fast404_path_check' => FALSE, + 'fast404_respect_redirect' => FALSE, + 'fast404_url_whitelisting' => TRUE, + 'fast404_whitelist' => [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ], + // phpcs:ignore #;> MODULE_FAST_404 + 'file_private_path' => 'sites/default/files/private', + 'file_public_path' => 'sites/default/files', + 'file_scan_ignore_directories' => [ + 'node_modules', + 'bower_components', + ], + 'file_temp_path' => '/tmp', + 'hash_salt' => hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'), + 'maintenance_theme' => 'claro', + 'trusted_host_patterns' => [ + '^localhost$', + ], + ]; + } + } From e5df6392d5bcb09687bf7095990b53308c967c53 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 11:50:20 +1000 Subject: [PATCH 03/12] Updated snapshots. --- .../Drupal/EnvironmentSettingsTest.php | 230 +++++------------- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 220 +---------------- .../Drupal/EnvironmentSettingsTest.php | 166 ++----------- .../Drupal/EnvironmentSettingsTest.php | 220 +---------------- .../Drupal/EnvironmentSettingsTest.php | 166 ++----------- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 166 ++----------- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 4 +- .../Drupal/EnvironmentSettingsTest.php | 168 ++----------- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 6 +- .../Drupal/EnvironmentSettingsTest.php | 48 +--- .../Drupal/EnvironmentSettingsTest.php | 66 +---- .../Drupal/EnvironmentSettingsTest.php | 66 +---- .../Drupal/EnvironmentSettingsTest.php | 72 +----- .../Drupal/EnvironmentSettingsTest.php | 80 ++---- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 114 ++------- .../Drupal/EnvironmentSettingsTest.php | 48 +--- .../Drupal/EnvironmentSettingsTest.php | 56 +---- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 48 +--- .../Drupal/EnvironmentSettingsTest.php | 12 +- .../Drupal/EnvironmentSettingsTest.php | 20 +- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 48 +--- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 175 +++---------- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 166 ++----------- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- 56 files changed, 392 insertions(+), 2069 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 2bb65d0dc0..17c58aafe0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -85,42 +85,7 @@ public function testEnvironmentNoOverrides(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; + $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); $this->assertSettings($settings); } @@ -182,42 +147,13 @@ public function testEnvironmentOverrides(): void { $this->assertConfig($config); // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ]; + $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; $settings['file_public_path'] = 'custom_public'; $settings['file_private_path'] = 'custom_private'; $settings['file_temp_path'] = 'custom_temp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; $settings['hash_salt'] = 'custom_hash_salt'; $settings['maintenance_theme'] = 'custom_theme'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -252,43 +188,8 @@ public function testEnvironmentLocal(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); $settings['skip_permissions_hardening'] = TRUE; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } @@ -323,43 +224,11 @@ public function testEnvironmentLocalContainer(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['config_sync_directory'] = '../config/default'; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); $settings['skip_permissions_hardening'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', - '^example\-site\.docker\.amazee\.io$', + '^example\\-site\\.docker\\.amazee\\.io$', '^nginx$', ]; @@ -437,45 +306,62 @@ public function testEnvironmentGha(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_CI; - $settings['fast404_allow_anon_imagecache'] = FALSE; - $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; - $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; - $settings['fast404_path_check'] = FALSE; - $settings['fast404_respect_redirect'] = FALSE; - $settings['fast404_url_whitelisting'] = TRUE; - $settings['fast404_whitelist'] = [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; - $settings['file_scan_ignore_directories'] = [ - 'node_modules', - 'bower_components', - ]; - $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); - $settings['maintenance_theme'] = 'claro'; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); $settings['skip_permissions_hardening'] = TRUE; - $settings['config_sync_directory'] = '../config/default'; - $settings['trusted_host_patterns'] = [ - '^localhost$', - ]; $this->assertSettings($settings); } + /** + * Settings that every environment produces. + * + * Each test overrides only the entries its environment changes. + * + * @param string $environment + * The environment type the settings are expected to report. + * + * @return array + * Array of expected settings. + */ + protected function expectedSettings(string $environment): array { + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], + 'entity_update_batch_size' => 50, + 'environment' => $environment, + 'fast404_allow_anon_imagecache' => FALSE, + 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', + 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', + 'fast404_path_check' => FALSE, + 'fast404_respect_redirect' => FALSE, + 'fast404_url_whitelisting' => TRUE, + 'fast404_whitelist' => [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ], + 'file_private_path' => 'sites/default/files/private', + 'file_public_path' => 'sites/default/files', + 'file_scan_ignore_directories' => [ + 'node_modules', + 'bower_components', + ], + 'file_temp_path' => '/tmp', + 'hash_salt' => hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'), + 'maintenance_theme' => 'claro', + 'trusted_host_patterns' => [ + '^localhost$', + ], + ]; + } + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e4c7a138fa..5559be1be5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -72,8 +72,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { } /** -@@ -476,6 +536,501 @@ - ]; +@@ -310,6 +370,299 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -105,42 +105,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -172,42 +138,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -239,42 +171,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -303,42 +201,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -371,42 +235,9 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; + $settings['config_sync_directory'] = 'custom_acquia_config'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -446,43 +277,10 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; + $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; + $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -573,4 +371,4 @@ class EnvironmentSettingsTest extends SettingsTestCase { + return $file; } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 36cf618544..cfe4aa84b5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -476,6 +656,339 @@ - ]; +@@ -310,6 +490,211 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -222,47 +222,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_test_branch'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -300,47 +268,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_develop'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -378,47 +314,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['cache_prefix']['default'] = 'test_project_master'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -454,47 +358,15 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['cache_prefix']['default'] = 'test_project_production'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -524,4 +396,4 @@ + ]); } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e4c7a138fa..5559be1be5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -72,8 +72,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { } /** -@@ -476,6 +536,501 @@ - ]; +@@ -310,6 +370,299 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -105,42 +105,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -172,42 +138,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -239,42 +171,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -303,42 +201,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -371,42 +235,9 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; + $settings['config_sync_directory'] = 'custom_acquia_config'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -446,43 +277,10 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; + $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; + $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; -+ $settings['trusted_host_patterns'] = [ -+ '^localhost$', -+ ]; + + $this->assertSettings($settings); + } @@ -573,4 +371,4 @@ class EnvironmentSettingsTest extends SettingsTestCase { + return $file; } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 36cf618544..cfe4aa84b5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -476,6 +656,339 @@ - ]; +@@ -310,6 +490,211 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -222,47 +222,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_test_branch'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -300,47 +268,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_develop'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -378,47 +314,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['cache_prefix']['default'] = 'test_project_master'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -454,47 +358,15 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['cache_prefix']['default'] = 'test_project_production'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -524,4 +396,4 @@ + ]); } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 36cf618544..cfe4aa84b5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -476,6 +656,339 @@ - ]; +@@ -310,6 +490,211 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -222,47 +222,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_test_branch'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -300,47 +268,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_develop'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -378,47 +314,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['cache_prefix']['default'] = 'test_project_master'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -454,47 +358,15 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['cache_prefix']['default'] = 'test_project_production'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -524,4 +396,4 @@ + ]); } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 9b896628d6..8eec3ee24c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -12,7 +12,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -407,9 +414,9 @@ +@@ -276,9 +283,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 6eca018a95..dc4f1cb081 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,7 +185,7 @@ } /** -@@ -163,6 +343,13 @@ +@@ -128,6 +308,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -199,8 +199,8 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -476,6 +663,339 @@ - ]; +@@ -310,6 +497,211 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -236,47 +236,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_test_branch'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -314,47 +282,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_develop'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -392,47 +328,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['cache_prefix']['default'] = 'test_project_master'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -468,47 +372,15 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['cache_prefix']['default'] = 'test_project_production'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -538,4 +410,4 @@ + ]); } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8adb9246e8..4761ce6516 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -163,6 +163,13 @@ +@@ -128,6 +128,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php index abd39e0628..543f2dd8b8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -233,7 +233,6 @@ +@@ -169,7 +169,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -6,7 +6,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -304,7 +303,6 @@ +@@ -205,7 +204,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -14,7 +14,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -417,7 +415,6 @@ +@@ -286,7 +284,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 6d42439aca..51eae7920f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,40 +1,8 @@ -@@ -87,7 +87,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', -@@ -184,7 +183,6 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', -@@ -254,7 +252,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', -@@ -325,7 +322,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', -@@ -439,7 +435,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', +@@ -327,7 +327,6 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5230616317..5c79744942 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,55 +1,11 @@ -@@ -87,10 +87,8 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -184,10 +182,8 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; -@@ -254,10 +250,8 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -325,10 +319,8 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -439,10 +431,8 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -327,10 +327,8 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ], + 'config_sync_directory' => '../config/default', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 10a2b1fe4f..3c1260c989 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,55 +1,11 @@ -@@ -87,10 +87,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -184,10 +181,7 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; -@@ -254,10 +248,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -325,10 +316,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -439,10 +427,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -327,10 +327,7 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ], + 'config_sync_directory' => '../config/default', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 0c29f62eef..07db473970 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,60 +1,12 @@ -@@ -87,11 +87,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -184,11 +180,7 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -254,11 +246,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -325,11 +313,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -439,11 +423,7 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; +@@ -327,11 +327,7 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 11847ccb08..13d7575da9 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -79,19 +79,11 @@ +@@ -79,9 +79,6 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -8,17 +8,7 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -175,9 +167,6 @@ +@@ -140,9 +137,6 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -28,19 +18,7 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -184,11 +173,6 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -245,9 +229,6 @@ +@@ -181,9 +175,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -50,19 +28,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -254,11 +235,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -316,9 +292,6 @@ +@@ -217,9 +208,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -72,19 +38,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -325,11 +298,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -430,9 +398,6 @@ +@@ -299,9 +287,6 @@ $config['system.logging']['error_level'] = 'all'; $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -94,15 +48,15 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -439,11 +404,6 @@ - - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; +@@ -327,11 +312,6 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php index e0bc8fd0eb..7783e169f1 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -10,7 +10,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -166,11 +161,6 @@ +@@ -131,11 +126,6 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -22,7 +22,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -234,11 +224,6 @@ +@@ -170,11 +160,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -34,7 +34,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -305,11 +290,6 @@ +@@ -206,11 +191,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -46,7 +46,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -418,11 +398,6 @@ +@@ -287,11 +267,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.ci']['status'] = TRUE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 200542f1bf..68be644bb6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,95 +1,19 @@ -@@ -96,18 +96,6 @@ - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -194,18 +182,6 @@ - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'custom_public'; - $settings['file_private_path'] = 'custom_private'; - $settings['file_temp_path'] = 'custom_temp'; -@@ -263,18 +239,6 @@ - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -334,18 +298,6 @@ - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -448,18 +400,6 @@ - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_CI; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; +@@ -337,18 +337,6 @@ + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], + 'entity_update_batch_size' => 50, + 'environment' => $environment, +- 'fast404_allow_anon_imagecache' => FALSE, +- 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', +- 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', +- 'fast404_path_check' => FALSE, +- 'fast404_respect_redirect' => FALSE, +- 'fast404_url_whitelisting' => TRUE, +- 'fast404_whitelist' => [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ], + 'file_private_path' => 'sites/default/files/private', + 'file_public_path' => 'sites/default/files', + 'file_scan_ignore_directories' => [ diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4821d0fd2c..a21acd1d91 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,40 +1,8 @@ -@@ -88,7 +88,6 @@ - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', -@@ -185,7 +184,6 @@ - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', -@@ -255,7 +253,6 @@ - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', -@@ -326,7 +323,6 @@ - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', -@@ -440,7 +436,6 @@ - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', +@@ -328,7 +328,6 @@ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d74f40beee..78c36ebdc4 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -8,15 +8,7 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -89,7 +86,6 @@ - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ]; -@@ -175,9 +171,6 @@ +@@ -140,9 +137,6 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -26,15 +18,7 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -186,7 +179,6 @@ - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ]; -@@ -245,9 +237,6 @@ +@@ -181,9 +175,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -44,15 +28,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -256,7 +245,6 @@ - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ]; -@@ -316,9 +304,6 @@ +@@ -217,9 +208,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -62,15 +38,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -327,7 +312,6 @@ - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ]; -@@ -430,9 +414,6 @@ +@@ -299,9 +287,6 @@ $config['system.logging']['error_level'] = 'all'; $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -80,11 +48,11 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -441,7 +422,6 @@ - $settings['config_exclude_modules'] = [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ]; +@@ -329,7 +314,6 @@ + 'config_exclude_modules' => [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ], diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php index ace5fae204..3875716add 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -171,7 +170,6 @@ +@@ -136,7 +135,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_SUT; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -14,7 +14,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -239,7 +237,6 @@ +@@ -175,7 +173,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -22,7 +22,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -310,7 +307,6 @@ +@@ -211,7 +208,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -30,7 +30,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -423,7 +419,6 @@ +@@ -292,7 +288,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_CI; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index cbe8b8f85b..2d18fffc0d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,40 +1,8 @@ -@@ -90,7 +90,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -187,7 +186,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; -@@ -257,7 +255,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -328,7 +325,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -442,7 +438,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -330,7 +330,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ], + 'config_sync_directory' => '../config/default', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php index a410fdb7e9..409f7bbb92 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -248,8 +248,6 @@ +@@ -184,8 +184,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -6,8 +6,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; -@@ -319,8 +317,6 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -220,8 +218,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -15,8 +15,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; -@@ -433,8 +429,6 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -302,8 +298,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -24,4 +24,4 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 2ffbc7fd0e..8559f38803 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -172,7 +171,6 @@ +@@ -137,7 +136,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -240,7 +238,6 @@ +@@ -176,7 +174,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -22,7 +22,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -248,8 +245,6 @@ +@@ -184,8 +181,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -30,8 +30,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; -@@ -311,7 +306,6 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -212,7 +207,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -39,7 +39,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -319,8 +313,6 @@ +@@ -220,8 +214,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -47,8 +47,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; -@@ -424,7 +416,6 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -293,7 +285,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -56,7 +56,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -433,8 +424,6 @@ +@@ -302,8 +293,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -64,4 +64,4 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 69906174e7..3db374984a 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -172,7 +171,6 @@ +@@ -137,7 +136,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -240,7 +238,6 @@ +@@ -176,7 +174,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -22,7 +22,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -311,7 +308,6 @@ +@@ -212,7 +209,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -30,7 +30,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -424,7 +420,6 @@ +@@ -293,7 +289,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php index beaebd17e9..b490ab196e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,40 +1,8 @@ -@@ -91,7 +91,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -188,7 +187,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -@@ -258,7 +256,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -329,7 +326,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; -@@ -443,7 +439,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; +@@ -331,7 +331,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php index efe67c1da5..ab54cfcb57 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; -@@ -173,7 +172,6 @@ +@@ -138,7 +137,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; @@ -14,7 +14,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; -@@ -241,7 +239,6 @@ +@@ -177,7 +175,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; @@ -22,7 +22,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -312,7 +309,6 @@ +@@ -213,7 +210,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; @@ -30,7 +30,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -425,7 +421,6 @@ +@@ -294,7 +290,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 0ad1db4d00..abe23b0177 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -70,44 +70,16 @@ +@@ -70,18 +70,7 @@ $this->requireSettingsFile(); @@ -17,33 +17,7 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -166,18 +138,7 @@ +@@ -131,18 +120,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -62,36 +36,7 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -184,28 +145,11 @@ - // Verify settings overrides. - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['config_sync_directory'] = 'custom_config'; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_SUT; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'custom_public'; - $settings['file_private_path'] = 'custom_private'; - $settings['file_temp_path'] = 'custom_temp'; -@@ -233,48 +177,17 @@ +@@ -169,23 +147,9 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -114,33 +59,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -304,48 +217,17 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -205,23 +169,9 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -163,33 +83,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_LOCAL; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; -@@ -417,49 +299,18 @@ + $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); +@@ -286,24 +236,10 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -213,29 +108,33 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings['auto_create_htaccess'] = FALSE; - $settings['config_exclude_modules'] = [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ]; - $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; - $settings['entity_update_batch_size'] = 50; - $settings['environment'] = self::ENVIRONMENT_CI; -- $settings['fast404_allow_anon_imagecache'] = FALSE; -- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -- $settings['fast404_path_check'] = FALSE; -- $settings['fast404_respect_redirect'] = FALSE; -- $settings['fast404_url_whitelisting'] = TRUE; -- $settings['fast404_whitelist'] = [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ]; - $settings['file_public_path'] = 'sites/default/files'; - $settings['file_private_path'] = 'sites/default/files/private'; - $settings['file_temp_path'] = '/tmp'; + $settings = $this->expectedSettings(self::ENVIRONMENT_CI); +@@ -327,28 +263,11 @@ + return [ + 'auto_create_htaccess' => FALSE, + 'config_exclude_modules' => [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ], + 'config_sync_directory' => '../config/default', + 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], + 'entity_update_batch_size' => 50, + 'environment' => $environment, +- 'fast404_allow_anon_imagecache' => FALSE, +- 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', +- 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', +- 'fast404_path_check' => FALSE, +- 'fast404_respect_redirect' => FALSE, +- 'fast404_url_whitelisting' => TRUE, +- 'fast404_whitelist' => [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ], + 'file_private_path' => 'sites/default/files/private', + 'file_public_path' => 'sites/default/files', + 'file_scan_ignore_directories' => [ diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php index a23b363e10..2487e420ba 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -176,8 +176,8 @@ +@@ -141,8 +141,8 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; @@ -20,7 +20,7 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -246,8 +246,8 @@ +@@ -182,8 +182,8 @@ $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; @@ -31,7 +31,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -317,8 +317,8 @@ +@@ -218,8 +218,8 @@ $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; @@ -42,7 +42,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -431,8 +431,8 @@ +@@ -300,8 +300,8 @@ $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 36cf618544..cfe4aa84b5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -476,6 +656,339 @@ - ]; +@@ -310,6 +490,211 @@ + $settings['skip_permissions_hardening'] = TRUE; $this->assertSettings($settings); + } @@ -222,47 +222,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_test_branch'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -300,47 +268,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['cache_prefix']['default'] = 'test_project_develop'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_DEV; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -378,47 +314,15 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['cache_prefix']['default'] = 'test_project_master'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_STAGE; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -454,47 +358,15 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings['auto_create_htaccess'] = FALSE; ++ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['cache_prefix']['default'] = 'test_project_production'; -+ $settings['config_exclude_modules'] = [ -+ 'devel', -+ 'generated_content', -+ 'reroute_email', -+ 'sdc_devel', -+ 'testmode', -+ ]; -+ $settings['config_sync_directory'] = '../config/default'; -+ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; -+ $settings['entity_update_batch_size'] = 50; -+ $settings['environment'] = self::ENVIRONMENT_PROD; -+ $settings['fast404_allow_anon_imagecache'] = FALSE; -+ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; -+ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; -+ $settings['fast404_path_check'] = FALSE; -+ $settings['fast404_respect_redirect'] = FALSE; -+ $settings['fast404_url_whitelisting'] = TRUE; -+ $settings['fast404_whitelist'] = [ -+ 'index.php', -+ 'rss.xml', -+ 'cron.php', -+ 'xmlrpc.php', -+ ]; -+ $settings['file_public_path'] = 'sites/default/files'; -+ $settings['file_private_path'] = 'sites/default/files/private'; -+ $settings['file_temp_path'] = '/tmp'; -+ $settings['file_scan_ignore_directories'] = [ -+ 'node_modules', -+ 'bower_components', -+ ]; -+ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); -+ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\-php$', -+ '^.+\.amazee\.io$', -+ '^example1\.com$', ++ '^nginx\\-php$', ++ '^.+\\.amazee\\.io$', ++ '^example1\\.com$', + '^example2$', + ]; + @@ -524,4 +396,4 @@ + ]); } - } + /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8d536ef2f5..237dabb857 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -407,9 +403,9 @@ +@@ -276,9 +272,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8d536ef2f5..237dabb857 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -407,9 +403,9 @@ +@@ -276,9 +272,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index d65f3bd498..dce1301f4d 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -407,9 +407,9 @@ +@@ -276,9 +276,9 @@ } /** From 2ab4fef18221b6c09b49b2685d585be7dfbc5f11 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 12:03:06 +1000 Subject: [PATCH 04/12] [#3115] Pinned the fixture repository's branch name in 'RepositoryDownloaderTest'. 'git init' takes the first branch name from the machine's 'init.defaultBranch', so the rows that resolve the 'main' reference depended on how the host was configured. --- .../tests/Unit/Downloader/RepositoryDownloaderTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php index 136f1ea131..0da6decde1 100644 --- a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php +++ b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php @@ -655,6 +655,10 @@ protected function createGitRepo(bool $with_composer_json = TRUE): string { $runner->run('git add .', output: new NullOutput()); $runner->run('git', args: ['commit', '-m', 'Initial commit'], output: new NullOutput()); + // 'git init' names the first branch after the machine's + // 'init.defaultBranch', so the tests that resolve 'main' pin it here. + $runner->run('git', args: ['branch', '-M', 'main'], output: new NullOutput()); + if ($with_composer_json) { File::dump($temp_repo_dir . '/composer.json', '{}'); $runner->run('git add composer.json', output: new NullOutput()); From 3ab121c67da24ba1ed0e8f37cb0b09a8a819a80a Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 12:22:03 +1000 Subject: [PATCH 05/12] [#3115] Documented the new data provider parameters and dropped the unreachable git check. The post-init existence check sat inside a branch that had already established the path was absent, and the exit code is what reports whether 'git init' succeeded. --- .vortex/installer/src/Utils/FileManager.php | 2 +- .../tests/Unit/Downloader/RepositoryDownloaderTest.php | 4 ++++ .vortex/installer/tests/Unit/Utils/FileManagerTest.php | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.vortex/installer/src/Utils/FileManager.php b/.vortex/installer/src/Utils/FileManager.php index 074007df39..195b98bb20 100644 --- a/.vortex/installer/src/Utils/FileManager.php +++ b/.vortex/installer/src/Utils/FileManager.php @@ -160,7 +160,7 @@ public function prepareDestination(): array { $command = sprintf('git -c advice.defaultBranchName=false --work-tree=%s --git-dir=%s init > /dev/null', escapeshellarg($destination), escapeshellarg($destination . '/.git')); passthru($command, $exit_code); - if ($exit_code !== 0 || !File::exists($destination . '/.git')) { + if ($exit_code !== 0) { throw new \RuntimeException(sprintf('Unable to initialize Git repository in directory "%s".', $destination)); } } diff --git a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php index 0da6decde1..62b248a551 100644 --- a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php +++ b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php @@ -473,6 +473,10 @@ public function testDownloadArchiveWithGithubToken(): void { * @param \Closure(self):array{0:?\GuzzleHttp\ClientInterface,1:string} $setup * Builds the HTTP client (NULL for a local repository) and the repository * to download from. + * @param string $ref + * Reference to download. + * @param string $expected_message + * Substring the thrown message must contain. */ #[DataProvider('dataProviderValidateFailure')] public function testValidateFailure(\Closure $setup, string $ref, string $expected_message): void { diff --git a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php index fa68c36acf..6220648171 100644 --- a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php +++ b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php @@ -41,6 +41,10 @@ public function testConstructor(): void { } /** + * @param string $subdir + * Path appended to the test directory to form the destination. + * @param bool $with_git + * Create a repository in the destination before preparing it. * @param array $expected_messages * Substrings every returned message set must contain. */ @@ -457,6 +461,8 @@ public function testRemoveObsoletePathsSilentOnMissing(): void { * Content for the project's '.env', or NULL to write none. * @param bool $with_database_file * Seed the data directory with an already-fetched database dump. + * @param string $expected_message + * Substring the returned messages must contain. */ #[DataProvider('dataProviderPrepareDemo')] public function testPrepareDemo(array $config_values, ?string $dotenv, bool $with_database_file, string $expected_message): void { From 8934d80a3226a94f85880c32c461ca69dee2c202 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 13:18:02 +1000 Subject: [PATCH 06/12] Addressed code review: kept an unreadable path from reaching the value branch. 'UpdateRegistry::write()' replaced the heading over a registry it could not read, discarding every entry recorded before the run, so it now reports the unreadable registry instead. A regression test covers it. The three JSON options that accept either a path or a literal now share 'OptionsResolver::readJsonOption()', so an existing path that cannot be read reports a read error rather than failing to parse as JSON. --- .../installer/src/Command/InstallCommand.php | 2 +- .../installer/src/Utils/OptionsResolver.php | 40 +++++++++++++------ .../installer/src/Utils/UpdateRegistry.php | 9 ++++- .../tests/Unit/Utils/UpdateRegistryTest.php | 14 +++++++ 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/.vortex/installer/src/Command/InstallCommand.php b/.vortex/installer/src/Command/InstallCommand.php index 2f939c9c6f..afd765ea1e 100644 --- a/.vortex/installer/src/Command/InstallCommand.php +++ b/.vortex/installer/src/Command/InstallCommand.php @@ -333,7 +333,7 @@ protected function handleValidate(InputInterface $input, OutputInterface $output return Command::FAILURE; } - $prompts_json = File::isReadable($prompts_option) ? File::read($prompts_option) : $prompts_option; + $prompts_json = OptionsResolver::readJsonOption($prompts_option, '--prompts'); $decoded = json_decode($prompts_json); if (!$decoded instanceof \stdClass) { diff --git a/.vortex/installer/src/Utils/OptionsResolver.php b/.vortex/installer/src/Utils/OptionsResolver.php index 5de498a3e7..ae3e2d0c08 100644 --- a/.vortex/installer/src/Utils/OptionsResolver.php +++ b/.vortex/installer/src/Utils/OptionsResolver.php @@ -35,6 +35,32 @@ public static function checkRequirements(ExecutableFinder $finder): void { } } + /** + * Read a JSON option given either as a file path or as a literal value. + * + * @param string $value + * The option value. + * @param string $option + * The option name, for the error message. + * + * @return string + * The JSON string. + * + * @throws \RuntimeException + * When the value names an existing path whose contents cannot be read. + */ + public static function readJsonOption(string $value, string $option): string { + if (!File::exists($value)) { + return $value; + } + + if (!File::isReadable($value)) { + throw new \RuntimeException(sprintf('Unable to read %s file: "%s".', $option, $value)); + } + + return File::read($value); + } + /** * Instantiate configuration from CLI options and environment variables. * @@ -53,8 +79,7 @@ public static function checkRequirements(ExecutableFinder $finder): void { public static function resolve(array $options): array { $config_json = '{}'; if (isset($options['config']) && is_scalar($options['config'])) { - $config_candidate = (string) $options['config']; - $config_json = File::isReadable($config_candidate) ? File::read($config_candidate) : $config_candidate; + $config_json = self::readJsonOption((string) $options['config'], '--config'); } $config = Config::fromString($config_json); @@ -117,16 +142,7 @@ public static function resolve(array $options): array { $config->set(Config::IS_DEMO_DB_FETCH_SKIP, (bool) Env::get(Config::IS_DEMO_DB_FETCH_SKIP, FALSE)); if (isset($options['prompts']) && is_scalar($options['prompts'])) { - $prompts_candidate = (string) $options['prompts']; - if (File::exists($prompts_candidate)) { - if (!File::isReadable($prompts_candidate)) { - throw new \RuntimeException(sprintf('Unable to read --prompts file: "%s".', $prompts_candidate)); - } - $prompts_json = File::read($prompts_candidate); - } - else { - $prompts_json = $prompts_candidate; - } + $prompts_json = self::readJsonOption((string) $options['prompts'], '--prompts'); $prompts = json_decode($prompts_json, TRUE); if (!is_array($prompts)) { diff --git a/.vortex/installer/src/Utils/UpdateRegistry.php b/.vortex/installer/src/Utils/UpdateRegistry.php index e189372a15..a3623c51f5 100644 --- a/.vortex/installer/src/Utils/UpdateRegistry.php +++ b/.vortex/installer/src/Utils/UpdateRegistry.php @@ -98,7 +98,14 @@ public function write(string $from, string $to, string $time): ?string { } $file = $this->destination . '/' . self::FILE; - $existing = File::isReadable($file) ? File::read($file) : self::HEADING . PHP_EOL; + + // A registry that exists but cannot be read would otherwise be replaced by + // the heading, discarding every entry recorded before this run. + if (File::exists($file) && !File::isReadable($file)) { + throw new \RuntimeException(sprintf('Unable to read the update registry "%s".', $file)); + } + + $existing = File::exists($file) ? File::read($file) : self::HEADING . PHP_EOL; File::dump($file, $existing . $content); diff --git a/.vortex/installer/tests/Unit/Utils/UpdateRegistryTest.php b/.vortex/installer/tests/Unit/Utils/UpdateRegistryTest.php index b2d3761e09..8cbe95fa10 100644 --- a/.vortex/installer/tests/Unit/Utils/UpdateRegistryTest.php +++ b/.vortex/installer/tests/Unit/Utils/UpdateRegistryTest.php @@ -137,4 +137,18 @@ public function testWriteAppendsToExistingRegistry(): void { $this->assertFileContainsString($file, '### behat.yml'); } + public function testWriteRefusesToReplaceUnreadableRegistry(): void { + // A directory at the registry path exists but cannot be read as a file, + // which is the condition that would otherwise discard the entries. + File::mkdir(self::$sut . '/' . UpdateRegistry::FILE); + + $registry = new UpdateRegistry(self::$sut); + $registry->add('phpstan.neon', "level: 5\n", "level: 8\n", "level: 9\n"); + + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('Unable to read the update registry'); + + $registry->write('1.40.0', '1.41.0', '2026-09-07 09:31:22'); + } + } From af5378774064e2988b10d26de8b2e5de02f917a4 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 13:59:49 +1000 Subject: [PATCH 07/12] Reverted the shared expected settings extraction in 'EnvironmentSettingsTest'. The file returns to the state it has on 'main', leaving this branch scoped to the installer. --- .../Drupal/EnvironmentSettingsTest.php | 845 ++++++++++++++++-- 1 file changed, 752 insertions(+), 93 deletions(-) diff --git a/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 3fcccb9c0a..127c2b8e62 100644 --- a/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -333,7 +333,54 @@ public function testEnvironmentNoOverrides(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -404,13 +451,54 @@ public function testEnvironmentOverrides(): void { $this->assertConfig($config); // Verify settings overrides. - $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 $settings['file_public_path'] = 'custom_public'; $settings['file_private_path'] = 'custom_private'; $settings['file_temp_path'] = 'custom_temp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; $settings['hash_salt'] = 'custom_hash_salt'; $settings['maintenance_theme'] = 'custom_theme'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -445,8 +533,55 @@ public function testEnvironmentLocal(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -482,11 +617,55 @@ public function testEnvironmentLocalContainer(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', - '^example\\-site\\.docker\\.amazee\\.io$', + '^example\-site\.docker\.amazee\.io$', '^nginx$', ]; @@ -566,8 +745,55 @@ public function testEnvironmentCircleCi(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_CI; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; + $settings['config_sync_directory'] = '../config/default'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -605,8 +831,55 @@ public function testEnvironmentGha(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_CI; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; + $settings['config_sync_directory'] = '../config/default'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -640,8 +913,54 @@ public function testEnvironmentAcquiaDynamic(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -673,8 +992,54 @@ public function testEnvironmentAcquiaDev(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -706,8 +1071,54 @@ public function testEnvironmentAcquiaStage(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_STAGE; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -736,8 +1147,54 @@ public function testEnvironmentAcquiaProd(): void { $config['system.performance']['js']['preprocess'] = TRUE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_PROD; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -770,9 +1227,54 @@ public function testEnvironmentAcquiaConfigPathOverride(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; $settings['config_sync_directory'] = 'custom_acquia_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -812,10 +1314,55 @@ public function testEnvironmentAcquiaConfigVcsDirectoryFallback(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); $settings['auto_create_htaccess'] = TRUE; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -939,15 +1486,59 @@ public function testEnvironmentLagoonPreview(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = FALSE; $settings['cache_prefix']['default'] = 'test_project_test_branch'; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\\-php$', - '^.+\\.amazee\\.io$', - '^example1\\.com$', + '^nginx\-php$', + '^.+\.amazee\.io$', + '^example1\.com$', '^example2$', ]; @@ -985,15 +1576,59 @@ public function testEnvironmentLagoonDev(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = FALSE; $settings['cache_prefix']['default'] = 'test_project_develop'; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_DEV; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\\-php$', - '^.+\\.amazee\\.io$', - '^example1\\.com$', + '^nginx\-php$', + '^.+\.amazee\.io$', + '^example1\.com$', '^example2$', ]; @@ -1031,15 +1666,59 @@ public function testEnvironmentLagoonTest(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['auto_create_htaccess'] = FALSE; $settings['cache_prefix']['default'] = 'test_project_master'; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_STAGE; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\\-php$', - '^.+\\.amazee\\.io$', - '^example1\\.com$', + '^nginx\-php$', + '^.+\.amazee\.io$', + '^example1\.com$', '^example2$', ]; @@ -1075,15 +1754,59 @@ public function testEnvironmentLagoonProd(): void { $config['system.performance']['js']['preprocess'] = TRUE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['auto_create_htaccess'] = FALSE; $settings['cache_prefix']['default'] = 'test_project_production'; + $settings['config_exclude_modules'] = [ + // phpcs:ignore #;< MODULE_DEVEL + 'devel', + // phpcs:ignore #;> MODULE_DEVEL + // phpcs:ignore #;< MODULE_GENERATED_CONTENT + 'generated_content', + // phpcs:ignore #;> MODULE_GENERATED_CONTENT + // phpcs:ignore #;< MODULE_REROUTE_EMAIL + 'reroute_email', + // phpcs:ignore #;> MODULE_REROUTE_EMAIL + // phpcs:ignore #;< MODULE_SDC_DEVEL + 'sdc_devel', + // phpcs:ignore #;> MODULE_SDC_DEVEL + // phpcs:ignore #;< MODULE_TESTMODE + 'testmode', + // phpcs:ignore #;> MODULE_TESTMODE + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_PROD; + // phpcs:ignore #;< MODULE_FAST_404 + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + // phpcs:ignore #;> MODULE_FAST_404 + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['reverse_proxy'] = TRUE; $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; $settings['trusted_host_patterns'] = [ '^localhost$', - '^nginx\\-php$', - '^.+\\.amazee\\.io$', - '^example1\\.com$', + '^nginx\-php$', + '^.+\.amazee\.io$', + '^example1\.com$', '^example2$', ]; @@ -1114,68 +1837,4 @@ public function testEnvironmentLagoonSchemelessRoutes(): void { } // phpcs:ignore #;> SETTINGS_PROVIDER_LAGOON - /** - * Settings that every environment produces. - * - * Each test overrides only the entries its environment changes. - * - * @param string $environment - * The environment type the settings are expected to report. - * - * @return array - * Array of expected settings. - */ - protected function expectedSettings(string $environment): array { - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ - // phpcs:ignore #;< MODULE_DEVEL - 'devel', - // phpcs:ignore #;> MODULE_DEVEL - // phpcs:ignore #;< MODULE_GENERATED_CONTENT - 'generated_content', - // phpcs:ignore #;> MODULE_GENERATED_CONTENT - // phpcs:ignore #;< MODULE_REROUTE_EMAIL - 'reroute_email', - // phpcs:ignore #;> MODULE_REROUTE_EMAIL - // phpcs:ignore #;< MODULE_SDC_DEVEL - 'sdc_devel', - // phpcs:ignore #;> MODULE_SDC_DEVEL - // phpcs:ignore #;< MODULE_TESTMODE - 'testmode', - // phpcs:ignore #;> MODULE_TESTMODE - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], - 'entity_update_batch_size' => 50, - 'environment' => $environment, - // phpcs:ignore #;< MODULE_FAST_404 - 'fast404_allow_anon_imagecache' => FALSE, - 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', - 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', - 'fast404_path_check' => FALSE, - 'fast404_respect_redirect' => FALSE, - 'fast404_url_whitelisting' => TRUE, - 'fast404_whitelist' => [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ], - // phpcs:ignore #;> MODULE_FAST_404 - 'file_private_path' => 'sites/default/files/private', - 'file_public_path' => 'sites/default/files', - 'file_scan_ignore_directories' => [ - 'node_modules', - 'bower_components', - ], - 'file_temp_path' => '/tmp', - 'hash_salt' => hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'), - 'maintenance_theme' => 'claro', - 'trusted_host_patterns' => [ - '^localhost$', - ], - ]; - } - } From 657ab3133967086fa30c2e13522c35e09b30e078 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 14:00:00 +1000 Subject: [PATCH 08/12] Updated snapshots. --- .../Drupal/EnvironmentSettingsTest.php | 230 +++++++++++++----- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 220 ++++++++++++++++- .../Drupal/EnvironmentSettingsTest.php | 166 +++++++++++-- .../Drupal/EnvironmentSettingsTest.php | 220 ++++++++++++++++- .../Drupal/EnvironmentSettingsTest.php | 166 +++++++++++-- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 166 +++++++++++-- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 4 +- .../Drupal/EnvironmentSettingsTest.php | 168 +++++++++++-- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 6 +- .../Drupal/EnvironmentSettingsTest.php | 48 +++- .../Drupal/EnvironmentSettingsTest.php | 66 ++++- .../Drupal/EnvironmentSettingsTest.php | 66 ++++- .../Drupal/EnvironmentSettingsTest.php | 72 +++++- .../Drupal/EnvironmentSettingsTest.php | 80 ++++-- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 114 +++++++-- .../Drupal/EnvironmentSettingsTest.php | 48 +++- .../Drupal/EnvironmentSettingsTest.php | 56 ++++- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 48 +++- .../Drupal/EnvironmentSettingsTest.php | 12 +- .../Drupal/EnvironmentSettingsTest.php | 20 +- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 48 +++- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 175 ++++++++++--- .../Drupal/EnvironmentSettingsTest.php | 8 +- .../Drupal/EnvironmentSettingsTest.php | 166 +++++++++++-- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- .../Drupal/EnvironmentSettingsTest.php | 2 +- 56 files changed, 2069 insertions(+), 392 deletions(-) diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 17c58aafe0..2bb65d0dc0 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -85,7 +85,42 @@ public function testEnvironmentNoOverrides(): void { $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -147,13 +182,42 @@ public function testEnvironmentOverrides(): void { $this->assertConfig($config); // Verify settings overrides. - $settings = $this->expectedSettings(self::ENVIRONMENT_SUT); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ]; $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; $settings['file_public_path'] = 'custom_public'; $settings['file_private_path'] = 'custom_private'; $settings['file_temp_path'] = 'custom_temp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; $settings['hash_salt'] = 'custom_hash_salt'; $settings['maintenance_theme'] = 'custom_theme'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -188,8 +252,43 @@ public function testEnvironmentLocal(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } @@ -224,11 +323,43 @@ public function testEnvironmentLocalContainer(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['config_sync_directory'] = '../config/default'; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; $settings['trusted_host_patterns'] = [ '^localhost$', - '^example\\-site\\.docker\\.amazee\\.io$', + '^example\-site\.docker\.amazee\.io$', '^nginx$', ]; @@ -306,62 +437,45 @@ public function testEnvironmentGha(): void { $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_CI; + $settings['fast404_allow_anon_imagecache'] = FALSE; + $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; + $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; + $settings['fast404_path_check'] = FALSE; + $settings['fast404_respect_redirect'] = FALSE; + $settings['fast404_url_whitelisting'] = TRUE; + $settings['fast404_whitelist'] = [ + 'index.php', + 'rss.xml', + 'cron.php', + 'xmlrpc.php', + ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; + $settings['file_scan_ignore_directories'] = [ + 'node_modules', + 'bower_components', + ]; + $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); + $settings['maintenance_theme'] = 'claro'; $settings['skip_permissions_hardening'] = TRUE; + $settings['config_sync_directory'] = '../config/default'; + $settings['trusted_host_patterns'] = [ + '^localhost$', + ]; $this->assertSettings($settings); } - /** - * Settings that every environment produces. - * - * Each test overrides only the entries its environment changes. - * - * @param string $environment - * The environment type the settings are expected to report. - * - * @return array - * Array of expected settings. - */ - protected function expectedSettings(string $environment): array { - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ - 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], - 'entity_update_batch_size' => 50, - 'environment' => $environment, - 'fast404_allow_anon_imagecache' => FALSE, - 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', - 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', - 'fast404_path_check' => FALSE, - 'fast404_respect_redirect' => FALSE, - 'fast404_url_whitelisting' => TRUE, - 'fast404_whitelist' => [ - 'index.php', - 'rss.xml', - 'cron.php', - 'xmlrpc.php', - ], - 'file_private_path' => 'sites/default/files/private', - 'file_public_path' => 'sites/default/files', - 'file_scan_ignore_directories' => [ - 'node_modules', - 'bower_components', - ], - 'file_temp_path' => '/tmp', - 'hash_salt' => hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'), - 'maintenance_theme' => 'claro', - 'trusted_host_patterns' => [ - '^localhost$', - ], - ]; - } - } diff --git a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/ciprovider_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/code_coverage_provider_codecov_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/deps_updates_provider_ci_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5559be1be5..e4c7a138fa 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -72,8 +72,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { } /** -@@ -310,6 +370,299 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +536,501 @@ + ]; $this->assertSettings($settings); + } @@ -105,8 +105,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -138,8 +172,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -171,8 +239,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -201,8 +303,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -235,9 +371,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; + $settings['config_sync_directory'] = 'custom_acquia_config'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -277,10 +446,43 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; + $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; + $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -371,4 +573,4 @@ class EnvironmentSettingsTest extends SettingsTestCase { + return $file; } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index cfe4aa84b5..36cf618544 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -310,6 +490,211 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +656,339 @@ + ]; $this->assertSettings($settings); + } @@ -222,15 +222,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_test_branch'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -268,15 +300,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_develop'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -314,15 +378,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_master'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -358,15 +454,47 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_production'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -396,4 +524,4 @@ + ]); } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5559be1be5..e4c7a138fa 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -72,8 +72,8 @@ class EnvironmentSettingsTest extends SettingsTestCase { } /** -@@ -310,6 +370,299 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +536,501 @@ + ]; $this->assertSettings($settings); + } @@ -105,8 +105,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -138,8 +172,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -171,8 +239,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -201,8 +303,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -235,9 +371,42 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; + $settings['config_sync_directory'] = 'custom_acquia_config'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -277,10 +446,43 @@ class EnvironmentSettingsTest extends SettingsTestCase { + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); + $settings['auto_create_htaccess'] = TRUE; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; + $settings['config_sync_directory'] = '/var/www/site-php/mysite/config'; + $settings['config_vcs_directory'] = '/var/www/site-php/mysite/config'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; ++ $settings['trusted_host_patterns'] = [ ++ '^localhost$', ++ ]; + + $this->assertSettings($settings); + } @@ -371,4 +573,4 @@ class EnvironmentSettingsTest extends SettingsTestCase { + return $file; } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index cfe4aa84b5..36cf618544 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -310,6 +490,211 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +656,339 @@ + ]; $this->assertSettings($settings); + } @@ -222,15 +222,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_test_branch'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -268,15 +300,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_develop'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -314,15 +378,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_master'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -358,15 +454,47 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_production'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -396,4 +524,4 @@ + ]); } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index cfe4aa84b5..36cf618544 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -310,6 +490,211 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +656,339 @@ + ]; $this->assertSettings($settings); + } @@ -222,15 +222,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_test_branch'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -268,15 +300,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_develop'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -314,15 +378,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_master'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -358,15 +454,47 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_production'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -396,4 +524,4 @@ + ]); } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8eec3ee24c..9b896628d6 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -12,7 +12,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -276,9 +283,9 @@ +@@ -407,9 +414,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dc4f1cb081..6eca018a95 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,7 +185,7 @@ } /** -@@ -128,6 +308,13 @@ +@@ -163,6 +343,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; @@ -199,8 +199,8 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. -@@ -310,6 +497,211 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +663,339 @@ + ]; $this->assertSettings($settings); + } @@ -236,15 +236,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_test_branch'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -282,15 +314,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_develop'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -328,15 +392,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_master'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -372,15 +468,47 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_production'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -410,4 +538,4 @@ + ]); } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_acquia/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_container_registry/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_ftp/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_s3/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 4761ce6516..8adb9246e8 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/migration_fetch_source_url/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -128,6 +128,13 @@ +@@ -163,6 +163,13 @@ $databases['default']['default']['collation'] = 'utf8_general_ci'; $databases['default']['default']['driver'] = 'mysql'; $databases['default']['default']['prefix'] = ''; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 543f2dd8b8..abd39e0628 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -169,7 +169,6 @@ +@@ -233,7 +233,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -6,7 +6,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -205,7 +204,6 @@ +@@ -304,7 +303,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -14,7 +14,7 @@ $config['environment_indicator.indicator']['bg_color'] = '#006600'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; -@@ -286,7 +284,6 @@ +@@ -417,7 +415,6 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 51eae7920f..6d42439aca 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,8 +1,40 @@ -@@ -327,7 +327,6 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', - 'generated_content', - 'reroute_email', - 'sdc_devel', +@@ -87,7 +87,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', +@@ -184,7 +183,6 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', +@@ -254,7 +252,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', +@@ -325,7 +322,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', +@@ -439,7 +435,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', + 'sdc_devel', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 5c79744942..5230616317 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,11 +1,55 @@ -@@ -327,10 +327,8 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ], - 'config_sync_directory' => '../config/default', +@@ -87,10 +87,8 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -184,10 +182,8 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; +@@ -254,10 +250,8 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -325,10 +319,8 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -439,10 +431,8 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 3c1260c989..10a2b1fe4f 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,11 +1,55 @@ -@@ -327,10 +327,7 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ], - 'config_sync_directory' => '../config/default', +@@ -87,10 +87,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -184,10 +181,7 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; +@@ -254,10 +248,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -325,10 +316,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -439,10 +427,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 07db473970..0c29f62eef 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,12 +1,60 @@ -@@ -327,11 +327,7 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', -- 'generated_content', - 'reroute_email', -- 'sdc_devel', -- 'testmode', - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], +@@ -87,11 +87,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -184,11 +180,7 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -254,11 +246,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -325,11 +313,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -439,11 +423,7 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', + 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 13d7575da9..11847ccb08 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_devel_sdc_devel_generated_content_testmode_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -79,9 +79,6 @@ +@@ -79,19 +79,11 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -8,7 +8,17 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -140,9 +137,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -175,9 +167,6 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -18,7 +28,19 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -181,9 +175,6 @@ +@@ -184,11 +173,6 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -245,9 +229,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -28,7 +50,19 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -217,9 +208,6 @@ +@@ -254,11 +235,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -316,9 +292,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -38,7 +72,19 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -299,9 +287,6 @@ +@@ -325,11 +298,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -430,9 +398,6 @@ $config['system.logging']['error_level'] = 'all'; $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -48,15 +94,15 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -327,11 +312,6 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], +@@ -439,11 +404,6 @@ + + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 7783e169f1..e0bc8fd0eb 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -10,7 +10,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -131,11 +126,6 @@ +@@ -166,11 +161,6 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -22,7 +22,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -170,11 +160,6 @@ +@@ -234,11 +224,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -34,7 +34,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -206,11 +191,6 @@ +@@ -305,11 +290,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.local']['status'] = TRUE; @@ -46,7 +46,7 @@ $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; -@@ -287,11 +267,6 @@ +@@ -418,11 +398,6 @@ $config['automated_cron.settings']['interval'] = 0; $config['config_split.config_split.ci']['status'] = TRUE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 68be644bb6..200542f1bf 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_fast_404/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,19 +1,95 @@ -@@ -337,18 +337,6 @@ - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], - 'entity_update_batch_size' => 50, - 'environment' => $environment, -- 'fast404_allow_anon_imagecache' => FALSE, -- 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', -- 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', -- 'fast404_path_check' => FALSE, -- 'fast404_respect_redirect' => FALSE, -- 'fast404_url_whitelisting' => TRUE, -- 'fast404_whitelist' => [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ], - 'file_private_path' => 'sites/default/files/private', - 'file_public_path' => 'sites/default/files', - 'file_scan_ignore_directories' => [ +@@ -96,18 +96,6 @@ + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -194,18 +182,6 @@ + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'custom_public'; + $settings['file_private_path'] = 'custom_private'; + $settings['file_temp_path'] = 'custom_temp'; +@@ -263,18 +239,6 @@ + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -334,18 +298,6 @@ + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -448,18 +400,6 @@ + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_CI; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php index a21acd1d91..4821d0fd2c 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_generated_content/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,8 +1,40 @@ -@@ -328,7 +328,6 @@ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ - 'devel', -- 'generated_content', - 'reroute_email', - 'sdc_devel', - 'testmode', +@@ -88,7 +88,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', +@@ -185,7 +184,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', +@@ -255,7 +253,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', +@@ -326,7 +323,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', +@@ -440,7 +436,6 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ + 'devel', +- 'generated_content', + 'reroute_email', + 'sdc_devel', + 'testmode', diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 78c36ebdc4..d74f40beee 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -8,7 +8,15 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -140,9 +137,6 @@ +@@ -89,7 +86,6 @@ + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ]; +@@ -175,9 +171,6 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; @@ -18,7 +26,15 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -181,9 +175,6 @@ +@@ -186,7 +179,6 @@ + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ]; +@@ -245,9 +237,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -28,7 +44,15 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -217,9 +208,6 @@ +@@ -256,7 +245,6 @@ + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ]; +@@ -316,9 +304,6 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -38,7 +62,15 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -299,9 +287,6 @@ +@@ -327,7 +312,6 @@ + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ]; +@@ -430,9 +414,6 @@ $config['system.logging']['error_level'] = 'all'; $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; @@ -48,11 +80,11 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -329,7 +314,6 @@ - 'config_exclude_modules' => [ - 'devel', - 'generated_content', -- 'reroute_email', - 'sdc_devel', - 'testmode', - ], +@@ -441,7 +422,6 @@ + $settings['config_exclude_modules'] = [ + 'devel', + 'generated_content', +- 'reroute_email', + 'sdc_devel', + 'testmode', + ]; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 3875716add..ace5fae204 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -136,7 +135,6 @@ +@@ -171,7 +170,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_SUT; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -14,7 +14,7 @@ $config['shield.settings']['shield_enable'] = TRUE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -175,7 +173,6 @@ +@@ -239,7 +237,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -22,7 +22,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -211,7 +208,6 @@ +@@ -310,7 +307,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_LOCAL; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; @@ -30,7 +30,7 @@ $config['shield.settings']['shield_enable'] = FALSE; $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; -@@ -292,7 +288,6 @@ +@@ -423,7 +419,6 @@ $config['environment_indicator.indicator']['name'] = self::ENVIRONMENT_CI; $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 2d18fffc0d..cbe8b8f85b 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,8 +1,40 @@ -@@ -330,7 +330,6 @@ - 'devel', - 'generated_content', - 'reroute_email', -- 'sdc_devel', - 'testmode', - ], - 'config_sync_directory' => '../config/default', +@@ -90,7 +90,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -187,7 +186,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; +@@ -257,7 +255,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -328,7 +325,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -442,7 +438,6 @@ + 'devel', + 'generated_content', + 'reroute_email', +- 'sdc_devel', + 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 409f7bbb92..a410fdb7e9 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -184,8 +184,6 @@ +@@ -248,8 +248,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -6,8 +6,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -220,8 +218,6 @@ + $settings['auto_create_htaccess'] = FALSE; +@@ -319,8 +317,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -15,8 +15,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -302,8 +298,6 @@ + $settings['auto_create_htaccess'] = FALSE; +@@ -433,8 +429,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -24,4 +24,4 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); + $settings['auto_create_htaccess'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 8559f38803..2ffbc7fd0e 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -137,7 +136,6 @@ +@@ -172,7 +171,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -176,7 +174,6 @@ +@@ -240,7 +238,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -22,7 +22,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -184,8 +181,6 @@ +@@ -248,8 +245,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -30,8 +30,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -212,7 +207,6 @@ + $settings['auto_create_htaccess'] = FALSE; +@@ -311,7 +306,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -39,7 +39,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -220,8 +214,6 @@ +@@ -319,8 +313,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -47,8 +47,8 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -293,7 +285,6 @@ + $settings['auto_create_htaccess'] = FALSE; +@@ -424,7 +416,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -56,7 +56,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -302,8 +293,6 @@ +@@ -433,8 +424,6 @@ $config['reroute_email.settings']['enable'] = FALSE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; $config['reroute_email.settings']['allowed'] = '*@star-wars.com'; @@ -64,4 +64,4 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); + $settings['auto_create_htaccess'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 3db374984a..69906174e7 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_shield/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -137,7 +136,6 @@ +@@ -172,7 +171,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -14,7 +14,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; -@@ -176,7 +174,6 @@ +@@ -240,7 +238,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -22,7 +22,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -212,7 +209,6 @@ +@@ -311,7 +308,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; @@ -30,7 +30,7 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; -@@ -293,7 +289,6 @@ +@@ -424,7 +420,6 @@ $config['environment_indicator.settings']['favicon'] = TRUE; $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php index b490ab196e..beaebd17e9 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_testmode/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,8 +1,40 @@ -@@ -331,7 +331,6 @@ - 'generated_content', - 'reroute_email', - 'sdc_devel', -- 'testmode', - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], +@@ -91,7 +91,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -188,7 +187,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; +@@ -258,7 +256,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -329,7 +326,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; +@@ -443,7 +439,6 @@ + 'generated_content', + 'reroute_email', + 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php index ab54cfcb57..efe67c1da5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -6,7 +6,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; -@@ -138,7 +137,6 @@ +@@ -173,7 +172,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = TRUE; @@ -14,7 +14,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; $config['reroute_email.settings']['address'] = 'webmaster@star-wars.com'; -@@ -177,7 +175,6 @@ +@@ -241,7 +239,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; @@ -22,7 +22,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -213,7 +210,6 @@ +@@ -312,7 +309,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; @@ -30,7 +30,7 @@ $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; -@@ -294,7 +290,6 @@ +@@ -425,7 +421,6 @@ $config['environment_indicator.settings']['toolbar_integration'] = [TRUE]; $config['robotstxt.settings']['content'] = "User-agent: *\nDisallow: /"; $config['shield.settings']['shield_enable'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php index abe23b0177..0ad1db4d00 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/modules_none/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -70,18 +70,7 @@ +@@ -70,44 +70,16 @@ $this->requireSettingsFile(); @@ -17,7 +17,33 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -131,18 +120,7 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -166,18 +138,7 @@ $this->assertEquals($databases, $this->databases); // Verify key config overrides. @@ -36,7 +62,36 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -169,23 +147,9 @@ +@@ -184,28 +145,11 @@ + // Verify settings overrides. + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['config_sync_directory'] = 'custom_config'; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_SUT; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'custom_public'; + $settings['file_private_path'] = 'custom_private'; + $settings['file_temp_path'] = 'custom_temp'; +@@ -233,48 +177,17 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -59,8 +114,33 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -205,23 +169,9 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -304,48 +217,17 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -83,8 +163,33 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_LOCAL); -@@ -286,24 +236,10 @@ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_LOCAL; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; +@@ -417,49 +299,18 @@ $this->requireSettingsFile(); $config['automated_cron.settings']['interval'] = 0; @@ -108,33 +213,29 @@ - $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); - $settings = $this->expectedSettings(self::ENVIRONMENT_CI); -@@ -327,28 +263,11 @@ - return [ - 'auto_create_htaccess' => FALSE, - 'config_exclude_modules' => [ -- 'devel', -- 'generated_content', -- 'reroute_email', -- 'sdc_devel', -- 'testmode', - ], - 'config_sync_directory' => '../config/default', - 'container_yamls' => [$this->app_root . '/' . $this->site_path . '/services.yml'], - 'entity_update_batch_size' => 50, - 'environment' => $environment, -- 'fast404_allow_anon_imagecache' => FALSE, -- 'fast404_exts' => '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i', -- 'fast404_html' => '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

', -- 'fast404_path_check' => FALSE, -- 'fast404_respect_redirect' => FALSE, -- 'fast404_url_whitelisting' => TRUE, -- 'fast404_whitelist' => [ -- 'index.php', -- 'rss.xml', -- 'cron.php', -- 'xmlrpc.php', -- ], - 'file_private_path' => 'sites/default/files/private', - 'file_public_path' => 'sites/default/files', - 'file_scan_ignore_directories' => [ + $settings['auto_create_htaccess'] = FALSE; + $settings['config_exclude_modules'] = [ +- 'devel', +- 'generated_content', +- 'reroute_email', +- 'sdc_devel', +- 'testmode', + ]; + $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; + $settings['entity_update_batch_size'] = 50; + $settings['environment'] = self::ENVIRONMENT_CI; +- $settings['fast404_allow_anon_imagecache'] = FALSE; +- $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; +- $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; +- $settings['fast404_path_check'] = FALSE; +- $settings['fast404_respect_redirect'] = FALSE; +- $settings['fast404_url_whitelisting'] = TRUE; +- $settings['fast404_whitelist'] = [ +- 'index.php', +- 'rss.xml', +- 'cron.php', +- 'xmlrpc.php', +- ]; + $settings['file_public_path'] = 'sites/default/files'; + $settings['file_private_path'] = 'sites/default/files/private'; + $settings['file_temp_path'] = '/tmp'; diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 2487e420ba..a23b363e10 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/names/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ $config['system.performance']['cache']['page']['max_age'] = 900; $this->assertConfig($config); -@@ -141,8 +141,8 @@ +@@ -176,8 +176,8 @@ $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE; $config['xmlsitemap_engines.settings']['submit'] = FALSE; $config['reroute_email.settings']['enable'] = TRUE; @@ -20,7 +20,7 @@ $config['system.performance']['cache']['page']['max_age'] = 1800; $this->assertConfig($config); -@@ -182,8 +182,8 @@ +@@ -246,8 +246,8 @@ $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; @@ -31,7 +31,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -218,8 +218,8 @@ +@@ -317,8 +317,8 @@ $config['system.logging']['error_level'] = 'all'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; @@ -42,7 +42,7 @@ $config['seckit.settings']['seckit_xss']['csp']['checkbox'] = FALSE; $config['seckit.settings']['seckit_xss']['csp']['upgrade-req'] = FALSE; $this->assertConfig($config); -@@ -300,8 +300,8 @@ +@@ -431,8 +431,8 @@ $config['system.mail']['interface']['default'] = 'test_mail_collector'; $config['system.performance']['cache']['page']['max_age'] = 900; $config['reroute_email.settings']['enable'] = FALSE; diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php index cfe4aa84b5..36cf618544 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -185,8 +185,8 @@ } /** -@@ -310,6 +490,211 @@ - $settings['skip_permissions_hardening'] = TRUE; +@@ -476,6 +656,339 @@ + ]; $this->assertSettings($settings); + } @@ -222,15 +222,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_test_branch'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -268,15 +300,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_DEV); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_develop'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_DEV; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -314,15 +378,47 @@ + $config['system.performance']['cache']['page']['max_age'] = 900; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_STAGE); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_master'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_STAGE; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -358,15 +454,47 @@ + $config['system.performance']['js']['preprocess'] = TRUE; + $this->assertConfig($config); + -+ $settings = $this->expectedSettings(self::ENVIRONMENT_PROD); ++ $settings['auto_create_htaccess'] = FALSE; + $settings['cache_prefix']['default'] = 'test_project_production'; ++ $settings['config_exclude_modules'] = [ ++ 'devel', ++ 'generated_content', ++ 'reroute_email', ++ 'sdc_devel', ++ 'testmode', ++ ]; ++ $settings['config_sync_directory'] = '../config/default'; ++ $settings['container_yamls'][0] = $this->app_root . '/' . $this->site_path . '/services.yml'; ++ $settings['entity_update_batch_size'] = 50; ++ $settings['environment'] = self::ENVIRONMENT_PROD; ++ $settings['fast404_allow_anon_imagecache'] = FALSE; ++ $settings['fast404_exts'] = '/^(?!\/robots)^(?!\/system\/files).*\.(txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'; ++ $settings['fast404_html'] = '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'; ++ $settings['fast404_path_check'] = FALSE; ++ $settings['fast404_respect_redirect'] = FALSE; ++ $settings['fast404_url_whitelisting'] = TRUE; ++ $settings['fast404_whitelist'] = [ ++ 'index.php', ++ 'rss.xml', ++ 'cron.php', ++ 'xmlrpc.php', ++ ]; ++ $settings['file_public_path'] = 'sites/default/files'; ++ $settings['file_private_path'] = 'sites/default/files/private'; ++ $settings['file_temp_path'] = '/tmp'; ++ $settings['file_scan_ignore_directories'] = [ ++ 'node_modules', ++ 'bower_components', ++ ]; ++ $settings['hash_salt'] = hash('sha256', getenv('DATABASE_HOST') ?: 'localhost'); ++ $settings['maintenance_theme'] = 'claro'; + $settings['reverse_proxy'] = TRUE; + $settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; + $settings['trusted_host_patterns'] = [ + '^localhost$', -+ '^nginx\\-php$', -+ '^.+\\.amazee\\.io$', -+ '^example1\\.com$', ++ '^nginx\-php$', ++ '^.+\.amazee\.io$', ++ '^example1\.com$', + '^example2$', + ]; + @@ -396,4 +524,4 @@ + ]); } - /** + } diff --git a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/timezone_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 237dabb857..8d536ef2f5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -276,9 +272,9 @@ +@@ -407,9 +403,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_dclint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_docker_linters_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_hadolint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index 237dabb857..8d536ef2f5 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -9,7 +9,7 @@ */ #[Group('drupal_settings')] class EnvironmentSettingsTest extends SettingsTestCase { -@@ -276,9 +272,9 @@ +@@ -407,9 +403,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** diff --git a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php index dce1301f4d..d65f3bd498 100644 --- a/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php +++ b/.vortex/installer/tests/Fixtures/handler_process/tools_no_twig_circleci/tests/phpunit/Drupal/EnvironmentSettingsTest.php @@ -1,4 +1,4 @@ -@@ -276,9 +276,9 @@ +@@ -407,9 +407,9 @@ } /** From 1e4a04ba1b370eae23c710a25930ffde3a94edc5 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Wed, 9 Sep 2026 14:28:02 +1000 Subject: [PATCH 09/12] Re-triggered CI to clear a flaky check. From 2a37b05ec158065c1ef7838ea99b51fcbb259ff0 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 10 Sep 2026 10:21:31 +1000 Subject: [PATCH 10/12] [#3115] Routed the remaining installer file operations through 'File'. Reading, writing, renaming, path resolution, directory checks and file size now go through 'File', which gained 'isWritable()', 'isDir()', 'size()' and 'rename()' alongside 'isReadable()'. The archive downloads land in a temporary directory of their own rather than being named directly in the system temp. Only the streaming handles in 'FileLogger', 'Archiver' and 'Tui', the 'glob()' pattern matches and the two single-level 'scandir()' listings remain, since 'File' offers no equivalent for any of them. --- .../src/Command/DestinationAwareTrait.php | 5 +- .vortex/installer/src/Downloader/Archiver.php | 6 +-- .../src/Downloader/RepositoryDownloader.php | 31 ++++++------ .vortex/installer/src/Logger/FileLogger.php | 2 +- .../src/Prompts/Handlers/CodeProvider.php | 2 +- .../src/Prompts/Handlers/CustomModules.php | 8 ++-- .../Prompts/Handlers/HostingProjectName.php | 8 ++-- .../src/Prompts/Handlers/Internal.php | 2 +- .../src/Prompts/Handlers/Webroot.php | 2 +- .vortex/installer/src/Utils/Env.php | 20 ++------ .vortex/installer/src/Utils/File.php | 48 +++++++++++++++++++ .vortex/installer/src/Utils/FileManager.php | 6 +-- .vortex/installer/src/Utils/Git.php | 2 +- .../installer/src/Utils/JsonManipulator.php | 15 +----- .vortex/installer/src/Utils/NpmLock.php | 12 ++--- 15 files changed, 93 insertions(+), 76 deletions(-) diff --git a/.vortex/installer/src/Command/DestinationAwareTrait.php b/.vortex/installer/src/Command/DestinationAwareTrait.php index 99ff140a92..7061099e2c 100644 --- a/.vortex/installer/src/Command/DestinationAwareTrait.php +++ b/.vortex/installer/src/Command/DestinationAwareTrait.php @@ -4,6 +4,7 @@ namespace DrevOps\VortexInstaller\Command; +use DrevOps\VortexInstaller\Utils\File; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -42,13 +43,13 @@ protected function getDestination(InputInterface $input): string { throw new \InvalidArgumentException('Destination must be a string.'); } - if (!is_dir($destination)) { + if (!File::isDir($destination)) { throw new \InvalidArgumentException( sprintf('Destination directory does not exist: %s', $destination) ); } - return realpath($destination) ?: $destination; + return File::realpath($destination); } } diff --git a/.vortex/installer/src/Downloader/Archiver.php b/.vortex/installer/src/Downloader/Archiver.php index d97cc42f1c..ea5667d229 100644 --- a/.vortex/installer/src/Downloader/Archiver.php +++ b/.vortex/installer/src/Downloader/Archiver.php @@ -57,7 +57,7 @@ public function validate(string $archive_path): void { throw new \RuntimeException(sprintf('Archive file does not exist: "%s".', $archive_path)); } - if (filesize($archive_path) === 0) { + if (File::size($archive_path) === 0) { throw new \RuntimeException('Archive is empty.'); } @@ -125,7 +125,7 @@ protected function extractTar(string $archive_path, string $destination, bool $s throw new \RuntimeException(sprintf('Unable to extract tar archive to "%s": %s.', $destination, $e->getMessage()), $e->getCode(), $e); } finally { - if ($strip_first_level && is_dir($temp_dir)) { + if ($strip_first_level && File::isDir($temp_dir)) { File::remove($temp_dir); } } @@ -167,7 +167,7 @@ protected function extractZip(string $archive_path, string $destination, bool $s throw new \RuntimeException(sprintf('Unable to extract ZIP archive to "%s": %s.', $destination, $e->getMessage()), $e->getCode(), $e); } finally { - if ($strip_first_level && is_dir($temp_dir)) { + if ($strip_first_level && File::isDir($temp_dir)) { File::remove($temp_dir); } } diff --git a/.vortex/installer/src/Downloader/RepositoryDownloader.php b/.vortex/installer/src/Downloader/RepositoryDownloader.php index 4f52ed2c4a..4dff1d5f6b 100644 --- a/.vortex/installer/src/Downloader/RepositoryDownloader.php +++ b/.vortex/installer/src/Downloader/RepositoryDownloader.php @@ -132,7 +132,8 @@ protected function downloadFromRemote(Artifact $artifact, ?string $destination, $archive_path = $this->downloadArchive($url); $this->archiver->validate($archive_path); $this->archiver->extract($archive_path, $destination, TRUE); - File::remove($archive_path); + // The archive is created inside a temporary directory of its own. + File::remove(dirname($archive_path)); return $version; } @@ -161,7 +162,8 @@ protected function downloadFromLocal(Artifact $artifact, ?string $destination): $archive_path = $this->archiveFromLocal($artifact->getRepo(), $ref); $this->archiver->validate($archive_path); $this->archiver->extract($archive_path, $destination, FALSE); - File::remove($archive_path); + // The archive is created inside a temporary directory of its own. + File::remove(dirname($archive_path)); return $version; } @@ -218,18 +220,14 @@ protected function discoverLatestReleaseRemote(string $repo_url, ?string $releas * If download fails. */ protected function downloadArchive(string $url): string { - $temp_file = tempnam(sys_get_temp_dir(), 'vortex_archive_'); - if ($temp_file === FALSE) { - throw new \RuntimeException('Unable to create temporary file for archive download.'); - } + $temp_dir = File::tmpdir(prefix: 'vortex_archive_'); + $temp_file = $temp_dir . DIRECTORY_SEPARATOR . 'archive.tar.gz'; try { $this->fileDownloader->download($url, $temp_file, self::requestHeaders($url)); } catch (\RuntimeException $e) { - if (File::exists($temp_file)) { - File::remove($temp_file); - } + File::remove($temp_dir); throw new \RuntimeException(sprintf('Unable to download archive from "%s": %s.', $url, $e->getMessage()), $e->getCode(), $e); } @@ -255,19 +253,18 @@ protected function archiveFromLocal(string $repo, string $ref): string { $this->git = new Git($repo); } - $temp_file = sys_get_temp_dir() . '/vortex_local_archive_' . uniqid() . '.tar'; + $temp_dir = File::tmpdir(prefix: 'vortex_local_archive_'); + $temp_file = $temp_dir . DIRECTORY_SEPARATOR . 'archive.tar'; try { $this->git->run('archive', '--format=tar', $ref, '-o', $temp_file); - if (!File::exists($temp_file) || filesize($temp_file) === 0) { + if (!File::exists($temp_file) || File::size($temp_file) === 0) { throw new \RuntimeException('Archive creation produced empty file.'); } } catch (\Exception $e) { - if (File::exists($temp_file)) { - File::remove($temp_file); - } + File::remove($temp_dir); throw new \RuntimeException(sprintf('Unable to create archive from local repository "%s": %s.', $repo, $e->getMessage()), $e->getCode(), $e); } @@ -341,11 +338,11 @@ protected function validateRemoteRefExists(string $repo_url, string $ref): void * If the repository does not exist or is not a valid git repository. */ protected function validateLocalRepositoryExists(string $repo): void { - if (!is_dir($repo)) { + if (!File::isDir($repo)) { throw new \RuntimeException(sprintf('Local repository path does not exist: "%s".', $repo)); } - if (!is_dir($repo . '/.git')) { + if (!File::isDir($repo . '/.git')) { throw new \RuntimeException(sprintf('Path is not a git repository: "%s".', $repo)); } } @@ -362,7 +359,7 @@ protected function validateLocalRepositoryExists(string $repo): void { * If the reference does not exist. */ protected function validateLocalRefExists(string $repo, string $ref): void { - $repo_path = (string) realpath($repo); + $repo_path = File::realpath($repo); if (!$this->git instanceof Git || $this->git->getRepositoryPath() !== $repo_path) { $this->git = new Git($repo); diff --git a/.vortex/installer/src/Logger/FileLogger.php b/.vortex/installer/src/Logger/FileLogger.php index bf44a5ff99..5b20399525 100644 --- a/.vortex/installer/src/Logger/FileLogger.php +++ b/.vortex/installer/src/Logger/FileLogger.php @@ -50,7 +50,7 @@ public function open(string $command, array $args = []): bool { $this->path = $this->getDir() . '/' . self::LOG_DIR . '/' . $name . '-' . date('Y-m-d-His') . '.log'; $log_dir = dirname($this->path); - if (!is_dir($log_dir)) { + if (!File::isDir($log_dir)) { File::mkdir($log_dir); } diff --git a/.vortex/installer/src/Prompts/Handlers/CodeProvider.php b/.vortex/installer/src/Prompts/Handlers/CodeProvider.php index c8fe183286..88edd32abc 100644 --- a/.vortex/installer/src/Prompts/Handlers/CodeProvider.php +++ b/.vortex/installer/src/Prompts/Handlers/CodeProvider.php @@ -72,7 +72,7 @@ public function process(): void { File::remove($t . '/.github/PULL_REQUEST_TEMPLATE.md'); if (File::exists($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md')) { - rename($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md', $t . '/.github/PULL_REQUEST_TEMPLATE.md'); + File::rename($t . '/.github/PULL_REQUEST_TEMPLATE.dist.md', $t . '/.github/PULL_REQUEST_TEMPLATE.md'); } } else { diff --git a/.vortex/installer/src/Prompts/Handlers/CustomModules.php b/.vortex/installer/src/Prompts/Handlers/CustomModules.php index 11440ced3a..542ad8cb3c 100644 --- a/.vortex/installer/src/Prompts/Handlers/CustomModules.php +++ b/.vortex/installer/src/Prompts/Handlers/CustomModules.php @@ -92,15 +92,15 @@ public function discover(): null|string|bool|array { $module_dir = $this->destinationDir . '/' . $this->webroot . '/modules/custom'; - if (is_dir($module_dir . '/' . $prefix . '_base')) { + if (File::isDir($module_dir . '/' . $prefix . '_base')) { $modules[] = self::BASE; } - if (is_dir($module_dir . '/' . $prefix . '_demo')) { + if (File::isDir($module_dir . '/' . $prefix . '_demo')) { $modules[] = self::DEMO; } - if (is_dir($module_dir . '/' . $prefix . '_search')) { + if (File::isDir($module_dir . '/' . $prefix . '_search')) { $modules[] = self::SEARCH; } @@ -220,7 +220,7 @@ protected function discoverModulePrefix(): ?string { protected static function removeDemoBehatFeatures(string $dir): void { $features_dir = $dir . '/tests/behat/features'; - if (!is_dir($features_dir)) { + if (!File::isDir($features_dir)) { return; } diff --git a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php index f1ce48061e..66ce449a6d 100644 --- a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php +++ b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php @@ -82,9 +82,9 @@ public function discover(): null|string|bool|array { // with older installations. $acquia_settings_file = $this->destinationDir . sprintf('/%s/sites/default/includes/providers/settings.acquia.php', $this->webroot); if (File::exists($acquia_settings_file)) { - $content = file_get_contents($acquia_settings_file); + $content = File::read($acquia_settings_file); // Require '/var/www/site-php/your_site/your_site-settings.inc';. - if ($content !== FALSE && preg_match('/require\s+[\'"]\/var\/www\/site-php\/([a-z0-9_]+)\/[a-z0-9_]+-settings\.inc[\'"]\s*;/', $content, $matches) && !empty($matches[1])) { + if (preg_match('/require\s+[\'"]\/var\/www\/site-php\/([a-z0-9_]+)\/[a-z0-9_]+-settings\.inc[\'"]\s*;/', $content, $matches) && !empty($matches[1])) { return $matches[1]; } } @@ -96,8 +96,8 @@ public function discover(): null|string|bool|array { $lagoon_site_file = $this->destinationDir . '/drush/sites/lagoon.site.yml'; if (File::exists($lagoon_site_file)) { - $content = file_get_contents($lagoon_site_file); - if ($content !== FALSE && preg_match('/user:\s*([a-z0-9_]+)-/', $content, $matches) && (!empty($matches[1]) && $matches[1] !== 'your_site')) { + $content = File::read($lagoon_site_file); + if (preg_match('/user:\s*([a-z0-9_]+)-/', $content, $matches) && (!empty($matches[1]) && $matches[1] !== 'your_site')) { return $matches[1]; } } diff --git a/.vortex/installer/src/Prompts/Handlers/Internal.php b/.vortex/installer/src/Prompts/Handlers/Internal.php index 0d4653066a..15d99bf70e 100644 --- a/.vortex/installer/src/Prompts/Handlers/Internal.php +++ b/.vortex/installer/src/Prompts/Handlers/Internal.php @@ -78,7 +78,7 @@ public function process(): void { }); if (File::exists($t . '/README.dist.md')) { - rename($t . '/README.dist.md', $t . '/README.md'); + File::rename($t . '/README.dist.md', $t . '/README.md'); } // Remove Vortex internal files. diff --git a/.vortex/installer/src/Prompts/Handlers/Webroot.php b/.vortex/installer/src/Prompts/Handlers/Webroot.php index 389e3b7768..2007c721c5 100644 --- a/.vortex/installer/src/Prompts/Handlers/Webroot.php +++ b/.vortex/installer/src/Prompts/Handlers/Webroot.php @@ -150,7 +150,7 @@ public function process(): void { File::replaceContentAsync(fn(string $content): string => preg_replace('/=' . preg_quote($webroot, '/') . '\b/', '=' . $v, $content) ?? $content); - rename($t . '/' . $webroot, $t . '/' . $v); + File::rename($t . '/' . $webroot, $t . '/' . $v); } } diff --git a/.vortex/installer/src/Utils/Env.php b/.vortex/installer/src/Utils/Env.php index ca7f972f09..2f6bdff560 100644 --- a/.vortex/installer/src/Utils/Env.php +++ b/.vortex/installer/src/Utils/Env.php @@ -86,12 +86,7 @@ public static function parseDotenv(string $filename = '.env'): array { return []; } - $contents = file_get_contents($filename); - if ($contents === FALSE) { - // @codeCoverageIgnoreStart - return []; - // @codeCoverageIgnoreEnd - } + $contents = File::read($filename); // Replace all # not inside quotes. $contents = preg_replace('/#(?=(?:(?:[^"]*"){2})*[^"]*$)/', ';', $contents); @@ -144,12 +139,7 @@ public static function writeValueDotenv(string $name, ?string $value = NULL, str throw new \RuntimeException(sprintf('File "%s" is not readable.', $filename)); } - $contents = file_get_contents($filename); - if ($contents === FALSE) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('Unable to read file "%s".', $filename)); - // @codeCoverageIgnoreEnd - } + $contents = File::read($filename); // Pattern to match the variable name and its value, including multiline // quoted values. Matches both normal and commented-out variables. @@ -185,11 +175,7 @@ public static function writeValueDotenv(string $name, ?string $value = NULL, str } } - if (file_put_contents($filename, $contents) === FALSE) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('Unable to write to file "%s".', $filename)); - // @codeCoverageIgnoreEnd - } + File::dump($filename, $contents); return self::parseDotenv($filename); } diff --git a/.vortex/installer/src/Utils/File.php b/.vortex/installer/src/Utils/File.php index 5060b26afe..13c117b23d 100644 --- a/.vortex/installer/src/Utils/File.php +++ b/.vortex/installer/src/Utils/File.php @@ -5,7 +5,9 @@ namespace DrevOps\VortexInstaller\Utils; use AlexSkrypnyk\File\ContentFile\ContentFile; +use AlexSkrypnyk\File\Exception\FileException; use AlexSkrypnyk\File\File as UpstreamFile; +use Symfony\Component\Filesystem\Filesystem; class File extends UpstreamFile { @@ -40,6 +42,52 @@ public static function isReadable(string $path): bool { return is_file($path) && is_readable($path); } + /** + * Check if an existing path can be written to. + * + * dump() replaces a file by renaming a temporary one over it, which succeeds + * on a read-only file whose directory is writable, so a caller that must + * respect the file's own permissions checks them here first. + */ + public static function isWritable(string $path): bool { + return is_writable($path); + } + + /** + * Check if path is a directory. + * + * Distinct from exists(), which is also TRUE for a file. + */ + public static function isDir(string $path): bool { + return is_dir($path); + } + + /** + * Get the size of a file in bytes. + * + * @throws \AlexSkrypnyk\File\Exception\FileException + * When the size cannot be read. + */ + public static function size(string $path): int { + $size = @filesize($path); + + if ($size === FALSE) { + throw new FileException(sprintf('Unable to read the size of "%s".', $path)); + } + + return $size; + } + + /** + * Move a file or directory. + * + * @throws \Symfony\Component\Filesystem\Exception\IOException + * When the move fails. + */ + public static function rename(string $origin, string $target, bool $overwrite = FALSE): void { + (new Filesystem())->rename($origin, $target, $overwrite); + } + /** * Get list of internal paths. */ diff --git a/.vortex/installer/src/Utils/FileManager.php b/.vortex/installer/src/Utils/FileManager.php index 195b98bb20..e881b6ae13 100644 --- a/.vortex/installer/src/Utils/FileManager.php +++ b/.vortex/installer/src/Utils/FileManager.php @@ -145,7 +145,7 @@ public function prepareDestination(): array { $messages = []; $destination = $this->config->getDestination(); - if (!is_dir($destination)) { + if (!File::isDir($destination)) { $destination = File::mkdir($destination); $messages[] = sprintf('Created directory "%s".', $destination); } @@ -210,7 +210,7 @@ public function copyFiles(): void { $this->recordReplacedChanges($src); - if (is_dir($src) && !File::dirIsEmpty($src)) { + if (File::isDir($src) && !File::dirIsEmpty($src)) { File::copy($src, $destination); } @@ -378,7 +378,7 @@ protected function hashDirectory(string $directory): array { * Relative file paths. */ protected function relativePaths(string $directory): array { - if (!is_dir($directory)) { + if (!File::isDir($directory)) { return []; } diff --git a/.vortex/installer/src/Utils/Git.php b/.vortex/installer/src/Utils/Git.php index 5c77322536..223233a007 100644 --- a/.vortex/installer/src/Utils/Git.php +++ b/.vortex/installer/src/Utils/Git.php @@ -90,7 +90,7 @@ public static function extractOwnerRepo(string $uri): ?string { * @todo Refactor to use GitPhp. */ public static function getTrackedFiles(string $dir): array { - if (!is_dir($dir . '/.git')) { + if (!File::isDir($dir . '/.git')) { throw new \RuntimeException('The directory is not a Git repository.'); } diff --git a/.vortex/installer/src/Utils/JsonManipulator.php b/.vortex/installer/src/Utils/JsonManipulator.php index eeaaf86af3..caed533530 100644 --- a/.vortex/installer/src/Utils/JsonManipulator.php +++ b/.vortex/installer/src/Utils/JsonManipulator.php @@ -18,16 +18,7 @@ public static function fromFile(string $composer_json): ?self { return NULL; } - $contents = file_get_contents($composer_json); - if ($contents === FALSE) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf( - 'Unable to read composer.json from %s: %s', - $composer_json, - error_get_last()['message'] ?? 'unknown error' - )); - // @codeCoverageIgnoreEnd - } + $contents = File::read($composer_json); try { $instance = new self($contents); @@ -62,9 +53,7 @@ public static function updateFile(string $file, callable $callback): void { $callback($instance); $contents = $instance->getContents(); - if (file_put_contents($file, $contents) !== strlen($contents)) { - throw new \RuntimeException(sprintf('Unable to write a JSON file at "%s".', $file)); - } + File::dump($file, $contents); } /** diff --git a/.vortex/installer/src/Utils/NpmLock.php b/.vortex/installer/src/Utils/NpmLock.php index eaf92e2a5c..7e29de64eb 100644 --- a/.vortex/installer/src/Utils/NpmLock.php +++ b/.vortex/installer/src/Utils/NpmLock.php @@ -160,13 +160,7 @@ protected static function resolve(\stdClass $packages, string $from, string $nam * Decode a JSON file into objects. */ protected static function read(string $file): \stdClass { - $contents = file_get_contents($file); - - if ($contents === FALSE) { - // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('Unable to read a JSON file at "%s".', $file)); - // @codeCoverageIgnoreEnd - } + $contents = File::read($file); try { $decoded = json_decode($contents, FALSE, 512, JSON_THROW_ON_ERROR); @@ -201,9 +195,11 @@ protected static function write(string $file, \stdClass $data): void { $json .= "\n"; - if (!is_writable($file) || file_put_contents($file, $json) !== strlen($json)) { + if (!File::isWritable($file)) { throw new \RuntimeException(sprintf('Unable to write a JSON file at "%s".', $file)); } + + File::dump($file, $json); } } From 68059bb7495ec25a8978d26e45b9e36a97264e93 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 10 Sep 2026 10:36:01 +1000 Subject: [PATCH 11/12] [#3115] Routed the installer test file operations through 'File'. The suite reached the filesystem directly in about 205 places, so a helper the source is required to use was bypassed wherever a fixture was built. 'File' gained 'chmod()' for the permission setups, and 'rename()' replaces an existing target as 'rename()' does rather than refusing it. Test scratch paths move from the system temp onto the harness temp root, so a run no longer writes outside its own workspace. --- .vortex/installer/src/Utils/File.php | 21 ++- .../Functional/Command/BuildCommandTest.php | 2 +- .../Command/CheckRequirementsCommandTest.php | 2 +- .../Functional/Command/InstallCommandTest.php | 4 +- .../installer/tests/Functional/PharTest.php | 2 +- .../AbstractHandlerProcessTestCase.php | 2 +- .../Handlers/ToolsHandlerProcessTest.php | 3 +- .../tests/Unit/Downloader/ArchiverTest.php | 6 +- .../Downloader/RepositoryDownloaderTest.php | 2 +- .../tests/Unit/Logger/FileLoggerTest.php | 6 +- .../AbstractHandlerDiscoveryTestCase.php | 23 +++- .../Handlers/ToolsHandlerDiscoveryTest.php | 8 +- .../tests/Unit/Runner/ProcessRunnerTest.php | 4 +- .vortex/installer/tests/Unit/UnitTestCase.php | 8 +- .../installer/tests/Unit/Utils/EnvTest.php | 39 +++--- .../tests/Unit/Utils/FileManagerTest.php | 122 +++++++++--------- .../installer/tests/Unit/Utils/GitTest.php | 20 +-- .../tests/Unit/Utils/JsonManipulatorTest.php | 12 +- .../tests/Unit/Utils/NpmLockTest.php | 8 +- .../tests/Unit/Utils/OptionsResolverTest.php | 3 +- .../tests/Unit/Utils/VersionTest.php | 2 +- .../installer/tests/Unit/Utils/YamlTest.php | 7 +- 22 files changed, 160 insertions(+), 146 deletions(-) diff --git a/.vortex/installer/src/Utils/File.php b/.vortex/installer/src/Utils/File.php index 13c117b23d..ca84481c3c 100644 --- a/.vortex/installer/src/Utils/File.php +++ b/.vortex/installer/src/Utils/File.php @@ -45,9 +45,9 @@ public static function isReadable(string $path): bool { /** * Check if an existing path can be written to. * - * dump() replaces a file by renaming a temporary one over it, which succeeds - * on a read-only file whose directory is writable, so a caller that must - * respect the file's own permissions checks them here first. + * A dump() replaces a file by renaming a temporary one over it, which + * succeeds on a read-only file whose directory is writable, so a caller that + * must respect the file's own permissions checks them here first. */ public static function isWritable(string $path): bool { return is_writable($path); @@ -81,13 +81,26 @@ public static function size(string $path): int { /** * Move a file or directory. * + * An existing target is replaced by default, as rename() does; pass FALSE to + * fail instead. + * * @throws \Symfony\Component\Filesystem\Exception\IOException * When the move fails. */ - public static function rename(string $origin, string $target, bool $overwrite = FALSE): void { + public static function rename(string $origin, string $target, bool $overwrite = TRUE): void { (new Filesystem())->rename($origin, $target, $overwrite); } + /** + * Change the mode of a file or directory. + * + * @throws \Symfony\Component\Filesystem\Exception\IOException + * When the mode cannot be changed. + */ + public static function chmod(string $path, int $mode, bool $recursive = FALSE): void { + (new Filesystem())->chmod($path, $mode, 0000, $recursive); + } + /** * Get list of internal paths. */ diff --git a/.vortex/installer/tests/Functional/Command/BuildCommandTest.php b/.vortex/installer/tests/Functional/Command/BuildCommandTest.php index 739408af6b..8e587a276d 100644 --- a/.vortex/installer/tests/Functional/Command/BuildCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/BuildCommandTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Functional\Command; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Command\BuildCommand; use DrevOps\VortexInstaller\Command\CheckRequirementsCommand; use DrevOps\VortexInstaller\Logger\FileLoggerInterface; diff --git a/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php b/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php index 6685ffc620..3c4be92673 100644 --- a/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/CheckRequirementsCommandTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Functional\Command; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Command\CheckRequirementsCommand; use DrevOps\VortexInstaller\Runner\ProcessRunner; use DrevOps\VortexInstaller\Runner\RunnerInterface; diff --git a/.vortex/installer/tests/Functional/Command/InstallCommandTest.php b/.vortex/installer/tests/Functional/Command/InstallCommandTest.php index 39b968f43c..abbbc39c12 100644 --- a/.vortex/installer/tests/Functional/Command/InstallCommandTest.php +++ b/.vortex/installer/tests/Functional/Command/InstallCommandTest.php @@ -523,8 +523,8 @@ public function testInstallCommandMajorGate(?string $version, string $composer_j // Pre-populate the destination so it looks like an existing Vortex project: // the README badge flags it as a Vortex project and the composer.json // 'drevops/vortex-tooling' constraint carries the project's major. - $this->assertNotFalse(file_put_contents(self::$sut . '/README.md', '[![Vortex](https://img.shields.io/badge/Vortex-1.40.0-65ACBC.svg)](https://github.com/drevops/vortex)')); - $this->assertNotFalse(file_put_contents(self::$sut . '/composer.json', $composer_json)); + File::dump(self::$sut . '/README.md', '[![Vortex](https://img.shields.io/badge/Vortex-1.40.0-65ACBC.svg)](https://github.com/drevops/vortex)'); + File::dump(self::$sut . '/composer.json', $composer_json); static::applicationInitFromCommand($install_command); diff --git a/.vortex/installer/tests/Functional/PharTest.php b/.vortex/installer/tests/Functional/PharTest.php index 1264b5f50f..2b0ce6a919 100644 --- a/.vortex/installer/tests/Functional/PharTest.php +++ b/.vortex/installer/tests/Functional/PharTest.php @@ -84,7 +84,7 @@ public function testPharOptionHelp(): void { protected static function buildPhar(string $destination): void { fwrite(STDERR, 'Building installer PHAR file...'); - if (!file_exists('vendor')) { + if (!File::exists('vendor')) { $exit_code = 0; passthru('composer install --no-dev --optimize-autoloader >/dev/null 2>&1 ', $exit_code); if ($exit_code !== 0) { diff --git a/.vortex/installer/tests/Functional/Prompts/Handlers/AbstractHandlerProcessTestCase.php b/.vortex/installer/tests/Functional/Prompts/Handlers/AbstractHandlerProcessTestCase.php index ddc4191539..0591325497 100644 --- a/.vortex/installer/tests/Functional/Prompts/Handlers/AbstractHandlerProcessTestCase.php +++ b/.vortex/installer/tests/Functional/Prompts/Handlers/AbstractHandlerProcessTestCase.php @@ -89,7 +89,7 @@ public function testHandlerProcess( abstract public static function dataProviderHandlerProcess(): \Iterator; protected function assertCommon(): void { - if (file_exists(static::$root . '/scripts/vortex.yml')) { + if (File::exists(static::$root . '/scripts/vortex.yml')) { $this->assertFileEquals(static::$root . '/tests/behat/fixtures/image.jpg', static::$sut . '/tests/behat/fixtures/image.jpg', 'Binary files were not modified.'); } diff --git a/.vortex/installer/tests/Functional/Prompts/Handlers/ToolsHandlerProcessTest.php b/.vortex/installer/tests/Functional/Prompts/Handlers/ToolsHandlerProcessTest.php index e9351cfb9b..07ab299d6c 100644 --- a/.vortex/installer/tests/Functional/Prompts/Handlers/ToolsHandlerProcessTest.php +++ b/.vortex/installer/tests/Functional/Prompts/Handlers/ToolsHandlerProcessTest.php @@ -7,6 +7,7 @@ use DrevOps\VortexInstaller\Prompts\Handlers\CiProvider; use DrevOps\VortexInstaller\Prompts\Handlers\Theme; use DrevOps\VortexInstaller\Prompts\Handlers\Tools; +use DrevOps\VortexInstaller\Utils\File; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(Tools::class)] @@ -718,7 +719,7 @@ protected static function assertNpmLockLacksPackages(string $manifest_file, arra protected static function readJson(string $file): array { self::assertFileExists($file); - return (array) json_decode((string) file_get_contents($file), TRUE, 512, JSON_THROW_ON_ERROR); + return (array) json_decode(File::read($file), TRUE, 512, JSON_THROW_ON_ERROR); } } diff --git a/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php b/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php index cdd0e5f508..e0969d030c 100644 --- a/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php +++ b/.vortex/installer/tests/Unit/Downloader/ArchiverTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Downloader; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Downloader\Archiver; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; use PHPUnit\Framework\Attributes\CoversClass; @@ -124,7 +124,7 @@ public function testExtract(string $creator, bool $strip, string $expected_path) $this->archiver->extract($archive_path, $destination, $strip); $this->assertFileExists($destination . $expected_path); - $this->assertEquals('Test content', file_get_contents($destination . $expected_path)); + $this->assertEquals('Test content', File::read($destination . $expected_path)); if ($strip) { $this->assertFileDoesNotExist($destination . '/test_archive'); @@ -224,7 +224,7 @@ protected function createTestTarGz(): string { $phar->buildFromDirectory($temp_dir); $phar->compress(\Phar::GZ); - rename($temp_dir . '/test.tar.gz', $archive_path); + File::rename($temp_dir . '/test.tar.gz', $archive_path); return $archive_path; } diff --git a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php index 62b248a551..28e4cbdcf7 100644 --- a/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php +++ b/.vortex/installer/tests/Unit/Downloader/RepositoryDownloaderTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Downloader; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Downloader\ArchiverInterface; use DrevOps\VortexInstaller\Downloader\Artifact; use DrevOps\VortexInstaller\Downloader\Downloader; diff --git a/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php b/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php index fe8466653b..7948cd3056 100644 --- a/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php +++ b/.vortex/installer/tests/Unit/Logger/FileLoggerTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Logger; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Logger\FileLogger; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; use PHPUnit\Framework\Attributes\CoversClass; @@ -178,7 +178,7 @@ public function testWrite(string $content, bool $is_open, int $expected_writes): $logger->close(); $path = $logger->getPath(); - $written_content = file_get_contents((string) $path); + $written_content = File::read((string) $path); $expected_content = str_repeat($content, $expected_writes); $this->assertEquals($expected_content, $written_content, 'Written content should match expected content'); @@ -238,7 +238,7 @@ public function testClose(): void { // empty. $logger->write('should not be written'); - $content = file_get_contents($path); + $content = File::read($path); $this->assertEquals('', $content, 'No content should be written after close()'); $logger->close(); diff --git a/.vortex/installer/tests/Unit/Prompts/Handlers/AbstractHandlerDiscoveryTestCase.php b/.vortex/installer/tests/Unit/Prompts/Handlers/AbstractHandlerDiscoveryTestCase.php index 29503a0d4f..93e0116ab4 100644 --- a/.vortex/installer/tests/Unit/Prompts/Handlers/AbstractHandlerDiscoveryTestCase.php +++ b/.vortex/installer/tests/Unit/Prompts/Handlers/AbstractHandlerDiscoveryTestCase.php @@ -253,7 +253,7 @@ public static function defaultTuiAnswers(): array { protected function stubComposerJsonValue(string $name, mixed $value): string { $composer_json = static::$sut . DIRECTORY_SEPARATOR . 'composer.json'; - file_put_contents($composer_json, json_encode([$name => $value], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + File::dump($composer_json, (string) json_encode([$name => $value], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); return $composer_json; } @@ -263,9 +263,8 @@ protected function stubComposerJsonDependencies(array $dependencies, bool $is_de $section = $is_dev ? 'require-dev' : 'require'; $data = []; - if (file_exists($composer_json)) { - $contents = file_get_contents($composer_json); - $existing = $contents !== FALSE ? json_decode($contents, TRUE) : NULL; + if (File::exists($composer_json)) { + $existing = json_decode(File::read($composer_json), TRUE); if ($existing) { $data = $existing; } @@ -275,7 +274,7 @@ protected function stubComposerJsonDependencies(array $dependencies, bool $is_de $data[$section] = array_merge($data[$section], $dependencies); - file_put_contents($composer_json, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + File::dump($composer_json, (string) json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); return $composer_json; } @@ -283,7 +282,12 @@ protected function stubComposerJsonDependencies(array $dependencies, bool $is_de protected function stubDotenvValue(string $name, mixed $value, string $filename = '.env'): string { $dotenv = static::$sut . DIRECTORY_SEPARATOR . $filename; - file_put_contents($dotenv, sprintf('%s=%s', $name, $value) . PHP_EOL, FILE_APPEND); + // append() requires the file to exist, and each stub may be the first. + if (!File::exists($dotenv)) { + File::dump($dotenv); + } + + File::append($dotenv, sprintf('%s=%s', $name, $value) . PHP_EOL); return $dotenv; } @@ -292,7 +296,12 @@ protected function stubVortexProject(Config $config): void { // Add a README.md file with a Vortex badge. $readme = static::$sut . DIRECTORY_SEPARATOR . 'README.md'; $repo_url = str_replace('.git', '', RepositoryDownloader::DEFAULT_REPO); - file_put_contents($readme, sprintf('[![Vortex](https://img.shields.io/badge/Vortex-1.2.3-65ACBC.svg)](%s/tree/1.2.3)', $repo_url) . PHP_EOL, FILE_APPEND); + + if (!File::exists($readme)) { + File::dump($readme); + } + + File::append($readme, sprintf('[![Vortex](https://img.shields.io/badge/Vortex-1.2.3-65ACBC.svg)](%s/tree/1.2.3)', $repo_url) . PHP_EOL); $config->set(Config::IS_VORTEX_PROJECT, TRUE); } diff --git a/.vortex/installer/tests/Unit/Prompts/Handlers/ToolsHandlerDiscoveryTest.php b/.vortex/installer/tests/Unit/Prompts/Handlers/ToolsHandlerDiscoveryTest.php index c7026d711c..6a8cb73292 100644 --- a/.vortex/installer/tests/Unit/Prompts/Handlers/ToolsHandlerDiscoveryTest.php +++ b/.vortex/installer/tests/Unit/Prompts/Handlers/ToolsHandlerDiscoveryTest.php @@ -38,7 +38,7 @@ function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { 'vincentlanglet/twig-cs-fixer' => '*', ]; $test->stubComposerJsonDependencies($dependencies, TRUE); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*', 'jest' => '*', 'stylelint' => '*']], JSON_PRETTY_PRINT)); + File::dump(static::$sut . '/package.json', (string) json_encode(['devDependencies' => ['eslint' => '*', 'jest' => '*', 'stylelint' => '*']], JSON_PRETTY_PRINT)); File::dump(static::$sut . '/.dclintrc'); File::dump(static::$sut . '/.circleci/config.yml', 'docker run --rm -i hadolint/hadolint'); }, @@ -182,7 +182,7 @@ function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { [Tools::id() => [Tools::JEST]] + $expected_installed, function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { $test->stubVortexProject($config); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['jest' => '*']], JSON_PRETTY_PRINT)); + File::dump(static::$sut . '/package.json', (string) json_encode(['devDependencies' => ['jest' => '*']], JSON_PRETTY_PRINT)); }, ]; yield 'tools - discovery - jest, alt' => [ @@ -198,7 +198,7 @@ function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { [Tools::id() => [Tools::ESLINT]] + $expected_installed, function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { $test->stubVortexProject($config); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['eslint' => '*']], JSON_PRETTY_PRINT)); + File::dump(static::$sut . '/package.json', (string) json_encode(['devDependencies' => ['eslint' => '*']], JSON_PRETTY_PRINT)); }, ]; yield 'tools - discovery - eslint, alt' => [ @@ -214,7 +214,7 @@ function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { [Tools::id() => [Tools::STYLELINT]] + $expected_installed, function (AbstractHandlerDiscoveryTestCase $test, Config $config): void { $test->stubVortexProject($config); - file_put_contents(static::$sut . '/package.json', json_encode(['devDependencies' => ['stylelint' => '*']], JSON_PRETTY_PRINT)); + File::dump(static::$sut . '/package.json', (string) json_encode(['devDependencies' => ['stylelint' => '*']], JSON_PRETTY_PRINT)); }, ]; yield 'tools - discovery - stylelint, alt' => [ diff --git a/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php b/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php index 2bdd5f2c27..7bddde35ef 100644 --- a/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php +++ b/.vortex/installer/tests/Unit/Runner/ProcessRunnerTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Runner; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Runner\ProcessRunner; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; use DrevOps\VortexInstaller\Utils\Tui; @@ -298,7 +298,7 @@ public function testResolveCommandWithRelativePath(): void { $script_path = $test_dir . '/test_script.sh'; File::dump($script_path, "#!/bin/sh\necho 'test'\n"); - chmod($script_path, 0755); + File::chmod($script_path, 0755); $runner->setCwd(self::$tmp); diff --git a/.vortex/installer/tests/Unit/UnitTestCase.php b/.vortex/installer/tests/Unit/UnitTestCase.php index 63128ca51c..0ed2ef6a29 100644 --- a/.vortex/installer/tests/Unit/UnitTestCase.php +++ b/.vortex/installer/tests/Unit/UnitTestCase.php @@ -10,6 +10,7 @@ use AlexSkrypnyk\PhpunitHelpers\Traits\SerializableClosureTrait; use AlexSkrypnyk\PhpunitHelpers\UnitTestCase as UpstreamUnitTestCase; use AlexSkrypnyk\Snapshot\Testing\SnapshotTrait; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Utils\Yaml; /** @@ -64,12 +65,7 @@ protected function assertYamlFileIsValid(string $filename): void { protected function assertJsonFileIsValid(string $filename): void { $this->assertFileExists($filename); - $content = file_get_contents($filename); - if ($content === FALSE) { - $this->fail(sprintf('Failed to read JSON file "%s".', $filename)); - } - - $this->assertJson($content, sprintf('JSON validation for file %s failed: %s', $filename, json_last_error_msg())); + $this->assertJson(File::read($filename), sprintf('JSON validation for file %s failed: %s', $filename, json_last_error_msg())); } } diff --git a/.vortex/installer/tests/Unit/Utils/EnvTest.php b/.vortex/installer/tests/Unit/Utils/EnvTest.php index eb17ffffe2..b101f52b52 100644 --- a/.vortex/installer/tests/Unit/Utils/EnvTest.php +++ b/.vortex/installer/tests/Unit/Utils/EnvTest.php @@ -117,7 +117,7 @@ public static function dataProviderPutFromDotenv(): \Iterator { public function testWriteValueDotenv(): void { $fixture_dir = dirname(__DIR__) . '/Fixtures/env'; $actual_file = static::$sut . '/.env'; - copy($fixture_dir . '/_baseline/.env', $actual_file); + File::copy($fixture_dir . '/_baseline/.env', $actual_file); // Apply updates to every variable to transform it to the after state. Env::writeValueDotenv('SIMPLE_VAR', 'new_simple_value', $actual_file); @@ -235,12 +235,12 @@ public function testParseDotenvFileNotReadable(): void { public function testParseDotenvFileReadFailure(): void { $filename = $this->createFixtureEnvFile('VAR=value'); - chmod($filename, 0000); + File::chmod($filename, 0000); $result = Env::parseDotenv($filename); $this->assertEquals([], $result); - chmod($filename, 0644); + File::chmod($filename, 0644); File::remove($filename); } @@ -284,7 +284,7 @@ public function testGetFromDotenvReturnsParsedValue(): void { $dir = dirname($filename); $dotenv_file = $dir . '/.env'; - rename($filename, $dotenv_file); + File::rename($filename, $dotenv_file); static::envUnset('TEST_VAR'); @@ -303,7 +303,7 @@ public function testWriteValueDotenvFileNotReadable(): void { public function testWriteValueDotenvFileReadFailure(): void { $filename = $this->createFixtureEnvFile('VAR=value'); - chmod($filename, 0000); + File::chmod($filename, 0000); $this->expectException(\RuntimeException::class); $this->expectExceptionMessage(sprintf('File "%s" is not readable.', $filename)); @@ -312,7 +312,7 @@ public function testWriteValueDotenvFileReadFailure(): void { Env::writeValueDotenv('TEST_VAR', 'value', $filename); } finally { - chmod($filename, 0644); + File::chmod($filename, 0644); File::remove($filename); } } @@ -322,7 +322,7 @@ public function testWriteValueDotenvAddNewVariableToFileWithoutNewline(): void { Env::writeValueDotenv('NEW_VAR', 'new_value', $filename); - $content = file_get_contents($filename); + $content = File::read($filename); $expected = "EXISTING_VAR=value\nNEW_VAR=new_value\n"; $this->assertEquals($expected, $content); @@ -334,7 +334,7 @@ public function testWriteValueDotenvReplaceVariableToFileWithoutNewline(): void Env::writeValueDotenv('NEW_VAR', 'new value with spaces', $filename); - $content = file_get_contents($filename); + $content = File::read($filename); $expected = "EXISTING_VAR=old_value\nNEW_VAR=\"new value with spaces\"\n"; $this->assertEquals($expected, $content); @@ -346,7 +346,7 @@ public function testWriteValueDotenvAddEmptyVariable(): void { Env::writeValueDotenv('NEW_VAR', NULL, $filename); - $content = file_get_contents($filename); + $content = File::read($filename); $expected = "EXISTING_VAR=value\nNEW_VAR=\n"; $this->assertEquals($expected, $content); @@ -358,7 +358,7 @@ public function testWriteValueDotenvAddEmptyVariableToFileWithoutNewline(): void Env::writeValueDotenv('NEW_VAR', NULL, $filename); - $content = file_get_contents($filename); + $content = File::read($filename); $expected = "EXISTING_VAR=value\nNEW_VAR=\n"; $this->assertEquals($expected, $content); @@ -371,7 +371,7 @@ public function testWriteValueDotenvWithEnabled(string $initial_content, string Env::writeValueDotenv($name, $value, $filename, $enabled); - $content = file_get_contents($filename); + $content = File::read($filename); $this->assertEquals($expected_content, $content); File::remove($filename); @@ -472,10 +472,9 @@ public static function dataProviderWriteValueDotenvWithEnabled(): \Iterator { } public function testParseDotenvFileGetContentsFailure(): void { - // A directory in place of the file makes file_get_contents() fail. - $dirname = tempnam(sys_get_temp_dir(), '.env'); - File::remove($dirname); - mkdir($dirname); + // A directory in place of the file is not readable as one. + $dirname = static::$tmp . '/' . uniqid('.env'); + File::mkdir($dirname); $result = Env::parseDotenv($dirname); $this->assertEquals([], $result); @@ -484,15 +483,9 @@ public function testParseDotenvFileGetContentsFailure(): void { } protected function createFixtureEnvFile(string $content): string { - $filename = tempnam(sys_get_temp_dir(), '.env'); - - if ($filename === FALSE) { - throw new \RuntimeException('Failed to create temporary file.'); - } + $filename = static::$tmp . '/' . uniqid('.env'); - if (file_put_contents($filename, $content) === FALSE) { - throw new \RuntimeException('Failed to write to temporary file.'); - } + File::dump($filename, $content); return $filename; } diff --git a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php index 6220648171..baf6b832fe 100644 --- a/.vortex/installer/tests/Unit/Utils/FileManagerTest.php +++ b/.vortex/installer/tests/Unit/Utils/FileManagerTest.php @@ -78,9 +78,9 @@ public static function dataProviderPrepareDestination(): \Iterator { public function testCopyFilesCopiesToDestination(): void { $src = self::$sut . '/src_copy'; $destination = self::$sut . '/dst_copy'; - mkdir($src, 0777, TRUE); - mkdir($destination, 0777, TRUE); - file_put_contents($src . '/test.txt', 'content'); + File::mkdir($src); + File::mkdir($destination); + File::dump($src . '/test.txt', 'content'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); @@ -88,15 +88,15 @@ public function testCopyFilesCopiesToDestination(): void { $fm->copyFiles(); $this->assertFileExists($destination . '/test.txt'); - $this->assertEquals('content', file_get_contents($destination . '/test.txt')); + $this->assertEquals('content', File::read($destination . '/test.txt')); } public function testCopyFilesCreatesEnvLocal(): void { $src = self::$sut . '/src_envlocal'; $destination = self::$sut . '/dst_envlocal'; - mkdir($src, 0777, TRUE); - mkdir($destination, 0777, TRUE); - file_put_contents($src . '/test.txt', 'content'); + File::mkdir($src); + File::mkdir($destination); + File::dump($src . '/test.txt', 'content'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); @@ -104,40 +104,40 @@ public function testCopyFilesCreatesEnvLocal(): void { $fm->copyFiles(); // Create the .env.local.example after copy. - file_put_contents($destination . '/.env.local.example', 'EXAMPLE=1'); + File::dump($destination . '/.env.local.example', 'EXAMPLE=1'); // Re-run to trigger the .env.local creation. // Recreate src for the second run. - mkdir($src, 0777, TRUE); - file_put_contents($src . '/dummy.txt', 'dummy'); + File::mkdir($src); + File::dump($src . '/dummy.txt', 'dummy'); $fm->copyFiles(); $this->assertFileExists($destination . '/.env.local'); - $this->assertEquals('EXAMPLE=1', file_get_contents($destination . '/.env.local')); + $this->assertEquals('EXAMPLE=1', File::read($destination . '/.env.local')); } public function testCopyFilesSkipsEnvLocalIfExists(): void { $src = self::$sut . '/src_envexist'; $destination = self::$sut . '/dst_envexist'; - mkdir($src, 0777, TRUE); - mkdir($destination, 0777, TRUE); - file_put_contents($src . '/test.txt', 'content'); - file_put_contents($destination . '/.env.local', 'EXISTING=1'); - file_put_contents($destination . '/.env.local.example', 'EXAMPLE=1'); + File::mkdir($src); + File::mkdir($destination); + File::dump($src . '/test.txt', 'content'); + File::dump($destination . '/.env.local', 'EXISTING=1'); + File::dump($destination . '/.env.local.example', 'EXAMPLE=1'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->copyFiles(); - $this->assertEquals('EXISTING=1', file_get_contents($destination . '/.env.local')); + $this->assertEquals('EXISTING=1', File::read($destination . '/.env.local')); } public function testCopyFilesHandlesEmptySrc(): void { $src = self::$sut . '/src_empty'; $destination = self::$sut . '/dst_empty'; - mkdir($src, 0777, TRUE); - mkdir($destination, 0777, TRUE); + File::mkdir($src); + File::mkdir($destination); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); @@ -150,17 +150,17 @@ public function testCopyFilesHandlesEmptySrc(): void { public function testCopyFilesRemovesUnmodifiedExcludedPaths(): void { $src = self::$sut . '/src_excluded'; $destination = self::$sut . '/dst_excluded'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/phpstan.neon', 'parameters: []'); - file_put_contents(File::mkdir($src . '/.circleci') . '/config.yml', 'version: 2.1'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($src . '/.circleci') . '/config.yml', 'version: 2.1'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); // A previous install wrote both, unmodified since. - file_put_contents(File::mkdir($destination) . '/phpstan.neon', 'parameters: []'); - file_put_contents(File::mkdir($destination . '/.circleci') . '/config.yml', 'version: 2.1'); + File::dump(File::mkdir($destination) . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($destination . '/.circleci') . '/config.yml', 'version: 2.1'); $this->stubPreviousTemplate($fm, $destination, [ 'phpstan.neon' => 'parameters: []', '.circleci/config.yml' => 'version: 2.1', @@ -183,15 +183,15 @@ public function testCopyFilesRemovesUnmodifiedExcludedPaths(): void { public function testCopyFilesKeepsModifiedExcludedPaths(): void { $src = self::$sut . '/src_modified'; $destination = self::$sut . '/dst_modified'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/phpstan.neon', 'parameters: []'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); // The project edited the file after the previous install wrote it. - file_put_contents(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 8"); + File::dump(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 8"); $this->stubPreviousTemplate($fm, $destination, ['phpstan.neon' => 'parameters: []']); $fm->snapshotTemplate(); @@ -206,8 +206,8 @@ public function testCopyFilesKeepsModifiedExcludedPaths(): void { public function testCopyFilesKeepsExcludedPathsWithoutRecordedHash(): void { $src = self::$sut . '/src_unverifiable'; $destination = self::$sut . '/dst_unverifiable'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/phpstan.neon', 'parameters: []'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); @@ -215,7 +215,7 @@ public function testCopyFilesKeepsExcludedPathsWithoutRecordedHash(): void { $fm->snapshotTemplate(); // No previous version, so ownership cannot be established. - file_put_contents(File::mkdir($destination) . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($destination) . '/phpstan.neon', 'parameters: []'); File::remove($src . '/phpstan.neon'); $fm->copyFiles(); @@ -226,8 +226,8 @@ public function testCopyFilesKeepsExcludedPathsWithoutRecordedHash(): void { public function testCopyFilesWritesNoManifest(): void { $src = self::$sut . '/src_no_manifest'; $destination = self::$sut . '/dst_no_manifest'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents(File::mkdir($src . '/scripts') . '/provision.sh', 'echo 1'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump(File::mkdir($src . '/scripts') . '/provision.sh', 'echo 1'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); @@ -241,15 +241,15 @@ public function testCopyFilesWritesNoManifest(): void { public function testCopyFilesRemovesExcludedPathsMatchedOnlyAfterRendering(): void { $src = self::$sut . '/src_rendered'; $destination = self::$sut . '/dst_rendered'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/rector.php', 'paths: your_site'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/rector.php', 'paths: your_site'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); // The project holds the rendered content, which the download never has. - file_put_contents(File::mkdir($destination) . '/rector.php', 'paths: star_wars'); + File::dump(File::mkdir($destination) . '/rector.php', 'paths: star_wars'); $this->stubPreviousTemplate($fm, $destination, ['rector.php' => 'paths: your_site'], function (string $dir): void { File::dump($dir . '/rector.php', 'paths: star_wars'); }); @@ -265,14 +265,14 @@ public function testCopyFilesRemovesExcludedPathsMatchedOnlyAfterRendering(): vo public function testCopyFilesRemovesExcludedPathsDeselectedByThisRun(): void { $src = self::$sut . '/src_deselected'; $destination = self::$sut . '/dst_deselected'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/jest.config.js', 'module.exports = {};'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/jest.config.js', 'module.exports = {};'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); - file_put_contents(File::mkdir($destination) . '/jest.config.js', 'module.exports = {};'); + File::dump(File::mkdir($destination) . '/jest.config.js', 'module.exports = {};'); // Discovery answers describe the project, which still has the tool, so // the render keeps the file even though this run deselects it. @@ -289,7 +289,7 @@ public function testCopyFilesRemovesExcludedPathsDeselectedByThisRun(): void { public function testCopyFilesRecordsReplacedProjectChanges(): void { $src = self::$sut . '/src_registry'; $destination = self::$sut . '/dst_registry'; - file_put_contents(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); + File::dump(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); @@ -297,7 +297,7 @@ public function testCopyFilesRecordsReplacedProjectChanges(): void { $fm = new FileManager($config); // The project edited the file the previous version installed. - file_put_contents(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 8\n"); + File::dump(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 8\n"); $this->stubPreviousTemplate($fm, $destination, ['phpstan.neon' => "parameters:\n level: 5\n"]); $fm->snapshotTemplate(); @@ -317,13 +317,13 @@ public function testCopyFilesRecordsReplacedProjectChanges(): void { public function testCopyFilesRecordsNothingWithoutProjectChanges(): void { $src = self::$sut . '/src_no_registry'; $destination = self::$sut . '/dst_no_registry'; - file_put_contents(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); + File::dump(File::mkdir($src) . '/phpstan.neon', "parameters:\n level: 9\n"); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); - file_put_contents(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 5\n"); + File::dump(File::mkdir($destination) . '/phpstan.neon', "parameters:\n level: 5\n"); $this->stubPreviousTemplate($fm, $destination, ['phpstan.neon' => "parameters:\n level: 5\n"]); $fm->snapshotTemplate(); @@ -336,13 +336,13 @@ public function testCopyFilesRecordsNothingWithoutProjectChanges(): void { public function testCopyFilesRemovesCommittedManifest(): void { $src = self::$sut . '/src_stale_manifest'; $destination = self::$sut . '/dst_stale_manifest'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); - file_put_contents(File::mkdir($destination) . '/.vortex-manifest.json', '{"composer.json":"abc"}'); + File::dump(File::mkdir($destination) . '/.vortex-manifest.json', '{"composer.json":"abc"}'); $fm->copyFiles(); @@ -352,12 +352,12 @@ public function testCopyFilesRemovesCommittedManifest(): void { public function testCopyFilesKeepsManifestInDestinationThatIsNotVortexProject(): void { $src = self::$sut . '/src_foreign_manifest'; $destination = self::$sut . '/dst_foreign_manifest'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); - file_put_contents(File::mkdir($destination) . '/.vortex-manifest.json', '{"owned":"by the project"}'); + File::dump(File::mkdir($destination) . '/.vortex-manifest.json', '{"owned":"by the project"}'); $fm->copyFiles(); @@ -367,15 +367,15 @@ public function testCopyFilesKeepsManifestInDestinationThatIsNotVortexProject(): public function testCopyFilesKeepsPathsTheTemplateNeverShipped(): void { $src = self::$sut . '/src_unknown'; $destination = self::$sut . '/dst_unknown'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); $fm->snapshotTemplate(); - file_put_contents(File::mkdir($destination) . '/phpstan.neon', 'project owned'); - file_put_contents(File::mkdir($destination . '/web/modules/custom/mymodule') . '/mymodule.info.yml', 'name: My module'); + File::dump(File::mkdir($destination) . '/phpstan.neon', 'project owned'); + File::dump(File::mkdir($destination . '/web/modules/custom/mymodule') . '/mymodule.info.yml', 'name: My module'); $fm->copyFiles(); @@ -386,14 +386,14 @@ public function testCopyFilesKeepsPathsTheTemplateNeverShipped(): void { public function testCopyFilesKeepsExcludedPathsForNonVortexProject(): void { $src = self::$sut . '/src_fresh'; $destination = self::$sut . '/dst_fresh'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents($src . '/phpstan.neon', 'parameters: []'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump($src . '/phpstan.neon', 'parameters: []'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); $fm->snapshotTemplate(); - file_put_contents(File::mkdir($destination) . '/phpstan.neon', 'project owned'); + File::dump(File::mkdir($destination) . '/phpstan.neon', 'project owned'); File::remove($src . '/phpstan.neon'); $fm->copyFiles(); @@ -404,15 +404,15 @@ public function testCopyFilesKeepsExcludedPathsForNonVortexProject(): void { public function testCopyFilesKeepsHarnessPaths(): void { $src = self::$sut . '/src_harness'; $destination = self::$sut . '/dst_harness'; - file_put_contents(File::mkdir($src) . '/composer.json', '{}'); - file_put_contents(File::mkdir($src . '/.vortex') . '/CLAUDE.md', 'harness'); + File::dump(File::mkdir($src) . '/composer.json', '{}'); + File::dump(File::mkdir($src . '/.vortex') . '/CLAUDE.md', 'harness'); $config = $this->createConfig($destination, $src); $config->set(Config::IS_VORTEX_PROJECT, TRUE, TRUE); $fm = new FileManager($config); $fm->snapshotTemplate(); - file_put_contents(File::mkdir($destination . '/.vortex') . '/CLAUDE.md', 'project owned'); + File::dump(File::mkdir($destination . '/.vortex') . '/CLAUDE.md', 'project owned'); File::remove($src . '/.vortex'); $fm->copyFiles(); @@ -426,11 +426,11 @@ public function testCopyFilesRemovesObsoleteScriptsVortex(): void { // package ships them instead, so the copy removes the legacy directory. $src = self::$sut . '/src_obsolete'; $destination = self::$sut . '/dst_obsolete'; - mkdir($src, 0777, TRUE); - mkdir($destination . '/scripts/vortex', 0777, TRUE); - file_put_contents($src . '/test.txt', 'new'); - file_put_contents($destination . '/scripts/vortex/legacy.sh', 'legacy'); - file_put_contents($destination . '/scripts/keep.sh', 'custom'); + File::mkdir($src); + File::mkdir($destination . '/scripts/vortex'); + File::dump($src . '/test.txt', 'new'); + File::dump($destination . '/scripts/vortex/legacy.sh', 'legacy'); + File::dump($destination . '/scripts/keep.sh', 'custom'); $config = $this->createConfig($destination, $src); $fm = new FileManager($config); @@ -444,7 +444,7 @@ public function testCopyFilesRemovesObsoleteScriptsVortex(): void { public function testRemoveObsoletePathsSilentOnMissing(): void { $destination = self::$sut . '/dst_no_obsolete'; - mkdir($destination, 0777, TRUE); + File::mkdir($destination); $config = $this->createConfig($destination); $fm = new FileManager($config); diff --git a/.vortex/installer/tests/Unit/Utils/GitTest.php b/.vortex/installer/tests/Unit/Utils/GitTest.php index d66c2e605d..7a8b6181cb 100644 --- a/.vortex/installer/tests/Unit/Utils/GitTest.php +++ b/.vortex/installer/tests/Unit/Utils/GitTest.php @@ -35,13 +35,13 @@ public static function dataProviderExtractOwnerRepo(): \Iterator { } public function testInit(): void { - $temp_dir = sys_get_temp_dir() . '/git_test_init_' . uniqid(); - mkdir($temp_dir); + $temp_dir = static::$tmp . '/git_test_init_' . uniqid(); + File::mkdir($temp_dir); $repo = Git::init($temp_dir); $this->assertInstanceOf(GitRepository::class, $repo); - $this->assertTrue(is_dir($temp_dir . '/.git')); + $this->assertTrue(File::isDir($temp_dir . '/.git')); $this->cleanupTempGitRepo($temp_dir); } @@ -89,8 +89,8 @@ public function testListRemotesWithRemotes(): void { } public function testGetTrackedFilesNonGitDirectory(): void { - $temp_dir = sys_get_temp_dir() . '/non_git_' . uniqid(); - mkdir($temp_dir); + $temp_dir = static::$tmp . '/non_git_' . uniqid(); + File::mkdir($temp_dir); $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('The directory is not a Git repository.'); @@ -152,8 +152,8 @@ public function testGetLastShortCommitId(): void { * Array with temp directory path and Git object. */ protected function createTempGitRepo(bool $with_remote = FALSE, bool $with_commits = FALSE): array { - $temp_dir = sys_get_temp_dir() . '/git_test_' . uniqid(); - mkdir($temp_dir); + $temp_dir = static::$tmp . '/git_test_' . uniqid(); + File::mkdir($temp_dir); Git::init($temp_dir); $repo = new Git($temp_dir); @@ -163,11 +163,11 @@ protected function createTempGitRepo(bool $with_remote = FALSE, bool $with_commi $repo->run('config', 'user.name', 'Test User'); $repo->run('config', 'user.email', 'test@example.com'); - file_put_contents($temp_dir . '/test.txt', 'test content'); + File::dump($temp_dir . '/test.txt', 'test content'); $repo->addAllChanges(); $repo->commit('Initial commit'); - file_put_contents($temp_dir . '/another.txt', 'another test'); + File::dump($temp_dir . '/another.txt', 'another test'); $repo->addAllChanges(); $repo->commit('Second commit'); } @@ -181,7 +181,7 @@ protected function createTempGitRepo(bool $with_remote = FALSE, bool $with_commi } protected function cleanupTempGitRepo(string $temp_dir): void { - if (is_dir($temp_dir)) { + if (File::isDir($temp_dir)) { File::remove($temp_dir); } } diff --git a/.vortex/installer/tests/Unit/Utils/JsonManipulatorTest.php b/.vortex/installer/tests/Unit/Utils/JsonManipulatorTest.php index 5f398fd1f0..dc25c87daf 100644 --- a/.vortex/installer/tests/Unit/Utils/JsonManipulatorTest.php +++ b/.vortex/installer/tests/Unit/Utils/JsonManipulatorTest.php @@ -65,21 +65,21 @@ public function testFromFileWithNonexistentFile(): void { public function testFromFileWithNonReadableFile(): void { $temp_file = $this->createTempJsonFile(self::SAMPLE_JSON); - chmod($temp_file, 0000); + File::chmod($temp_file, 0000); try { $manipulator = JsonManipulator::fromFile($temp_file); $this->assertNull($manipulator); } finally { - chmod($temp_file, 0644); + File::chmod($temp_file, 0644); File::remove($temp_file); } } public function testFromFileWithDirectory(): void { - $temp_dir = sys_get_temp_dir() . '/json_test_dir_' . uniqid(); - mkdir($temp_dir); + $temp_dir = static::$tmp . '/json_test_dir_' . uniqid(); + File::mkdir($temp_dir); try { $manipulator = JsonManipulator::fromFile($temp_dir); @@ -209,8 +209,8 @@ public function testGetPropertyArrayAccess(): void { } protected function createTempJsonFile(string $content): string { - $temp_file = tempnam(sys_get_temp_dir(), 'json_test_'); - file_put_contents($temp_file, $content); + $temp_file = static::$tmp . '/' . uniqid('json_test_'); + File::dump($temp_file, $content); return $temp_file; } diff --git a/.vortex/installer/tests/Unit/Utils/NpmLockTest.php b/.vortex/installer/tests/Unit/Utils/NpmLockTest.php index 58b3d9be15..2a9a392d2c 100644 --- a/.vortex/installer/tests/Unit/Utils/NpmLockTest.php +++ b/.vortex/installer/tests/Unit/Utils/NpmLockTest.php @@ -167,7 +167,7 @@ public function testSyncWritesTheFileTheWayNpmWritesIt(): void { NpmLock::sync($manifest_file); - $contents = (string) file_get_contents(dirname($manifest_file) . '/package-lock.json'); + $contents = File::read(dirname($manifest_file) . '/package-lock.json'); $this->assertStringContainsString("\n \"lockfileVersion\": 3,", $contents); $this->assertStringContainsString("\n \"node_modules/keep\": {", $contents); @@ -182,7 +182,7 @@ public function testSyncPreservesEmptyObjects(): void { NpmLock::sync($manifest_file); - $this->assertStringContainsString('"bin": {}', (string) file_get_contents(dirname($manifest_file) . '/package-lock.json')); + $this->assertStringContainsString('"bin": {}', File::read(dirname($manifest_file) . '/package-lock.json')); } #[DataProvider('dataProviderSyncThrows')] @@ -217,7 +217,7 @@ public function testSyncThrowsWhenLockIsNotWritable(): void { ['packages' => ['' => ['dependencies' => ['keep' => '^1.0.0']]]] ); - chmod(dirname($manifest_file) . '/package-lock.json', 0444); + File::chmod(dirname($manifest_file) . '/package-lock.json', 0444); $this->expectException(\RuntimeException::class); $this->expectExceptionMessageMatches('/Unable to write a JSON file/'); @@ -242,7 +242,7 @@ protected function createPair(array $manifest, ?array $lock): string { } protected function readLock(string $manifest_file): array { - return (array) json_decode((string) file_get_contents(dirname($manifest_file) . '/package-lock.json'), TRUE, 512, JSON_THROW_ON_ERROR); + return (array) json_decode(File::read(dirname($manifest_file) . '/package-lock.json'), TRUE, 512, JSON_THROW_ON_ERROR); } } diff --git a/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php b/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php index 9e47c32562..7d0cdfb87f 100644 --- a/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php +++ b/.vortex/installer/tests/Unit/Utils/OptionsResolverTest.php @@ -8,6 +8,7 @@ use DrevOps\VortexInstaller\Downloader\RepositoryDownloader; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; use DrevOps\VortexInstaller\Utils\Config; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Utils\OptionsResolver; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; @@ -125,7 +126,7 @@ public function testResolveWithConfigJsonString(): void { public function testResolveWithConfigJsonFile(): void { $config_file = self::$sut . '/config.json'; - file_put_contents($config_file, '{"VORTEX_PROJECT_NAME":"file_project"}'); + File::dump($config_file, '{"VORTEX_PROJECT_NAME":"file_project"}'); $options = self::defaultOptions([ 'config' => $config_file, diff --git a/.vortex/installer/tests/Unit/Utils/VersionTest.php b/.vortex/installer/tests/Unit/Utils/VersionTest.php index 4312faabc1..8a3ca288c4 100644 --- a/.vortex/installer/tests/Unit/Utils/VersionTest.php +++ b/.vortex/installer/tests/Unit/Utils/VersionTest.php @@ -4,7 +4,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Utils; -use AlexSkrypnyk\File\File; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; use DrevOps\VortexInstaller\Utils\Version; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/.vortex/installer/tests/Unit/Utils/YamlTest.php b/.vortex/installer/tests/Unit/Utils/YamlTest.php index 2957f7c61f..6cf11bd118 100644 --- a/.vortex/installer/tests/Unit/Utils/YamlTest.php +++ b/.vortex/installer/tests/Unit/Utils/YamlTest.php @@ -5,6 +5,7 @@ namespace DrevOps\VortexInstaller\Tests\Unit\Utils; use DrevOps\VortexInstaller\Tests\Unit\UnitTestCase; +use DrevOps\VortexInstaller\Utils\File; use DrevOps\VortexInstaller\Utils\Yaml; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; @@ -19,8 +20,8 @@ public function testValidateFile(string $yaml_content, string $expected_exceptio $this->expectExceptionMessage($expected_exception_message); } - $temp_file = tempnam(sys_get_temp_dir(), 'yaml_test_'); - file_put_contents($temp_file, $yaml_content); + $temp_file = static::$tmp . '/' . uniqid('yaml_test_'); + File::dump($temp_file, $yaml_content); Yaml::validateFile($temp_file); @@ -51,7 +52,7 @@ public function testValidateFileNonExistent(): void { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('File does not exist or is not readable'); - $non_existent_file = sys_get_temp_dir() . '/non_existent_file.yml'; + $non_existent_file = static::$tmp . '/non_existent_file.yml'; Yaml::validateFile($non_existent_file); } From 6189b2d1b2fb367451a247189d9411c9e9511aff Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 10 Sep 2026 11:06:52 +1000 Subject: [PATCH 12/12] Addressed code review: cleaned up the archive directory on every exit path. A throw from 'validate()' or 'extract()' skipped the cleanup, leaving the archive's temporary directory behind, so both call sites now remove it in a 'finally'. 'HostingProjectName::discover()' reads both configuration files it finds, so it guards them with 'isReadable()' rather than 'exists()', which is also true for a directory and would abort discovery instead of falling through to the next source. --- .../src/Downloader/RepositoryDownloader.php | 26 +++++++++++++------ .../Prompts/Handlers/HostingProjectName.php | 4 +-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.vortex/installer/src/Downloader/RepositoryDownloader.php b/.vortex/installer/src/Downloader/RepositoryDownloader.php index 4dff1d5f6b..8d8dcafc83 100644 --- a/.vortex/installer/src/Downloader/RepositoryDownloader.php +++ b/.vortex/installer/src/Downloader/RepositoryDownloader.php @@ -130,10 +130,15 @@ protected function downloadFromRemote(Artifact $artifact, ?string $destination, $url = sprintf(self::ARCHIVE_URL_TEMPLATE, $repo_url, $ref); $archive_path = $this->downloadArchive($url); - $this->archiver->validate($archive_path); - $this->archiver->extract($archive_path, $destination, TRUE); - // The archive is created inside a temporary directory of its own. - File::remove(dirname($archive_path)); + + try { + $this->archiver->validate($archive_path); + $this->archiver->extract($archive_path, $destination, TRUE); + } + finally { + // The archive is created inside a temporary directory of its own. + File::remove(dirname($archive_path)); + } return $version; } @@ -160,10 +165,15 @@ protected function downloadFromLocal(Artifact $artifact, ?string $destination): } $archive_path = $this->archiveFromLocal($artifact->getRepo(), $ref); - $this->archiver->validate($archive_path); - $this->archiver->extract($archive_path, $destination, FALSE); - // The archive is created inside a temporary directory of its own. - File::remove(dirname($archive_path)); + + try { + $this->archiver->validate($archive_path); + $this->archiver->extract($archive_path, $destination, FALSE); + } + finally { + // The archive is created inside a temporary directory of its own. + File::remove(dirname($archive_path)); + } return $version; } diff --git a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php index 66ce449a6d..36d8e626aa 100644 --- a/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php +++ b/.vortex/installer/src/Prompts/Handlers/HostingProjectName.php @@ -81,7 +81,7 @@ public function discover(): null|string|bool|array { // instead of a hardcoded project name. Kept for backward compatibility // with older installations. $acquia_settings_file = $this->destinationDir . sprintf('/%s/sites/default/includes/providers/settings.acquia.php', $this->webroot); - if (File::exists($acquia_settings_file)) { + if (File::isReadable($acquia_settings_file)) { $content = File::read($acquia_settings_file); // Require '/var/www/site-php/your_site/your_site-settings.inc';. if (preg_match('/require\s+[\'"]\/var\/www\/site-php\/([a-z0-9_]+)\/[a-z0-9_]+-settings\.inc[\'"]\s*;/', $content, $matches) && !empty($matches[1])) { @@ -95,7 +95,7 @@ public function discover(): null|string|bool|array { } $lagoon_site_file = $this->destinationDir . '/drush/sites/lagoon.site.yml'; - if (File::exists($lagoon_site_file)) { + if (File::isReadable($lagoon_site_file)) { $content = File::read($lagoon_site_file); if (preg_match('/user:\s*([a-z0-9_]+)-/', $content, $matches) && (!empty($matches[1]) && $matches[1] !== 'your_site')) { return $matches[1];