drupal: make simpletest DB URL configurable

This commit is contained in:
Oliver Davies 2024-08-10 13:07:18 +01:00
parent 5eb658ddec
commit afcca18c9e
4 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,8 @@
---
drupal:
docroot: web
simpletest:
db: sqlite://localhost//dev/shm/test.sqlite
experimental:
runStaticAnalysisOnTests: false

View file

@ -31,7 +31,7 @@ final class CreateFinalConfigurationDataCommand
// Flatten the new `parameters` into the main configuration.
if (isset($configurationData['parameters'])) {
$configurationData = array_merge($configurationData, [...$configurationData['parameters']]);
$configurationData = array_replace_recursive($configurationData, [...$configurationData['parameters']]);
}
// `flake` renamed to `nix`.

View file

@ -105,7 +105,15 @@ final class ConfigDto
#[Assert\Collection(
allowExtraFields: false,
fields: ['docroot' => new Assert\Choice([null, 'web', 'docroot'])],
fields: [
'docroot' => new Assert\Choice([null, 'web', 'docroot']),
'simpletest' => new Assert\Optional(
new Assert\Collection([
'db' => new Assert\Optional(new Assert\Type('string')),
]),
),
],
)]
public array $drupal;

View file

@ -17,7 +17,7 @@
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value=''/>
<env name="MINK_DRIVER_CLASS" value=''/>
<env name="SIMPLETEST_BASE_URL" value="http://web"/>
<env name="SIMPLETEST_DB" value="sqlite://localhost//dev/shm/test.sqlite"/>
<env name="SIMPLETEST_DB" value="{{ drupal.simpletest.db }}"/>
<ini name="error_reporting" value="32767"/>
<ini name="memory_limit" value="-1"/>