feat: add a phpunit.xml.dist file for Drupal

Fixes #15
This commit is contained in:
Oliver Davies 2023-03-03 21:59:26 +00:00
parent 5f1c8afa9c
commit 3449ec5390
2 changed files with 40 additions and 0 deletions

View file

@ -112,6 +112,9 @@ final class BuildConfigurationCommand extends Command
if (null === Arr::get($configurationData, 'drupal.docroot')) {
Arr::set($configurationData, 'drupal.docroot', 'web');
}
// Add a Drupal version of phpunit.xml.dist.
$this->filesToGenerate->push(['drupal-project/phpunit.xml.dist', 'phpunit.xml.dist']);
}
$this->generateFiles($configurationData);

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
bootstrap="{{ drupal.docroot }}/core/tests/bootstrap.php"
cacheResult="false"
colors="true"
failOnWarning="true"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"
>
<php>
<env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<env name="MINK_DRIVER_ARGS" value=''/>
<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"/>
<ini name="error_reporting" value="32767"/>
<ini name="memory_limit" value="-1"/>
</php>
<testsuites>
<testsuite name="functional">
<directory>./{{ drupal.docroot }}/modules/custom/**/tests/**/Functional</directory>
</testsuite>
<testsuite name="kernel">
<directory>./{{ drupal.docroot }}/modules/custom/**/tests/**/Kernel</directory>
</testsuite>
<testsuite name="unit">
<directory>./{{ drupal.docroot }}/modules/custom/**/tests/**/Unit</directory>
</testsuite>
</testsuites>
</phpunit>