Skip to content

Instantly share code, notes, and snippets.

@twfahey1
Created October 11, 2019 00:34
Show Gist options
  • Save twfahey1/cd6bf2489c3606394de641c210fb229a to your computer and use it in GitHub Desktop.
Save twfahey1/cd6bf2489c3606394de641c210fb229a to your computer and use it in GitHub Desktop.
Docksal PHPUnit file for web docroot Drupal 8
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="/var/www/web/core/tests/bootstrap.php" colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<env name="DTT_BASE_URL" value="http://utdk8-docksal.docksal"/>
<env name="DTT_API_URL" value="http://localhost:9222"/>
<env name="SIMPLETEST_BASE_URL" value="http://utdk8-docksal.docksal"/>
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value="mysql://user:user@db/default"/>
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/var/www/web/sites/simpletest/browser_output"/>
<!-- To disable deprecation testing completely uncomment the next line. -->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
<!-- Example for changing the driver class for mink tests MINK_DRIVER_CLASS value: 'Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver' -->
<!-- Example for changing the driver args to mink tests MINK_DRIVER_ARGS value: '["http://127.0.0.1:8510"]' -->
<!-- Example for changing the driver args to phantomjs tests MINK_DRIVER_ARGS_PHANTOMJS value: '["http://127.0.0.1:8510"]' -->
<!-- Example for changing the driver args to webdriver tests MINK_DRIVER_ARGS_WEBDRIVER value: '["firefox", null, "http://localhost:4444/wd/hub"]' -->
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
</php>
<testsuites>
<testsuite name="functional">
<file>/var/www/web/core/tests/TestSuites/FunctionalTestSuite.php</file>
</testsuite>
<testsuite name="functional-javascript">
<file>/var/www/web/core/tests/TestSuites/FunctionalJavascriptTestSuite.php</file>
</testsuite>
<testsuite name="existing-site">
<!-- This assumes tests are namespaced as
`\Drupal\Tests\custom_profile_foo\ExistingSite`. -->
<directory>/var/www/web/modules/custom/*/tests/src/ExistingSite</directory>
<directory>/var/www/.docksal/drupal/testing/tests/src/ExistingSite</directory>
<!--<directory>./web/profiles/custom/*/tests/src/ExistingSite</directory>-->
</testsuite>
<testsuite name="existing-site-javascript">
<!-- This assumes tests are namespaced as
`\Drupal\Tests\custom_module_foo\ExistingSiteJavascript`. -->
<directory>/var/www/web/modules/custom/*/tests/src/ExistingSiteJavascript</directory>
<directory>/var/www/.docksal/drupal/testing/tests/src/ExistingSiteJavascript</directory>
<!-- This assumes tests are namespaced as
`\Drupal\Tests\custom_profile_foo\ExistingSiteJavascript`. -->
<!--<directory>./web/profiles/custom/*/tests/src/ExistingSiteJavascript</directory>-->
</testsuite>
</testsuites>
<listeners>
<listener class="\Drupal\Tests\Listeners\DrupalListener">
</listener>
<!-- The Symfony deprecation listener has to come after the Drupal listener -->
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
</listener>
</listeners>
<!-- Filter for coverage reports. -->
<filter>
<whitelist>
<directory>/var/www/web/core/includes</directory>
<directory>/var/www/web/core/lib</directory>
<directory>/var/www/web/core/modules</directory>
<directory>/var/www/web/modules</directory>
<directory>/var/www/web/sites</directory>
<!-- Exclude all test modules, tests etc -->
<exclude-pattern>*/tests/*</exclude-pattern>
</whitelist>
</filter>
</phpunit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment