<?xml version="1.0" encoding="UTF-8"?>

<!--
  PHPUnit configuration of the Shortloop project, derived from
  web/core/phpunit.xml.dist. Run it inside the shortloop_apache container
  with `make test` or `make coverage`.

  The <env> values below are the local Docker defaults. A variable already set
  in the environment (in CI, for example) takes precedence.
-->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="web/core/tests/bootstrap.php"
         colors="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutOutputDuringTests="true"
         beStrictAboutChangesToGlobalState="true"
         failOnRisky="true"
         failOnWarning="true"
         failOnPhpunitWarning="true"
         displayDetailsOnTestsThatTriggerErrors="true"
         displayDetailsOnTestsThatTriggerWarnings="true"
         displayDetailsOnTestsThatTriggerDeprecations="true"
         cacheResult="false"
         cacheDirectory=".phpunit.cache">
  <php>
    <ini name="error_reporting" value="32767"/>
    <ini name="memory_limit" value="-1"/>
    <!-- The test site is served by the Apache of this container. -->
    <env name="SIMPLETEST_BASE_URL" value="http://shortloop.localhost"/>
    <!-- Dedicated database, see docker/README.md. -->
    <env name="SIMPLETEST_DB" value="mysql://user:password@shortloop_mysql:3306/drupal_test"/>
    <env name="BROWSERTEST_OUTPUT_BASE_URL" value="http://shortloop.localhost"/>
    <env name="MINK_DRIVER_CLASS" value=""/>
    <env name="MINK_DRIVER_ARGS" value=""/>
    <env name="MINK_DRIVER_ARGS_WEBDRIVER" value=""/>
  </php>
  <extensions>
    <bootstrap class="Drupal\TestTools\Extension\HtmlLogging\HtmlOutputLogger">
      <parameter name="outputDirectory" value="web/sites/simpletest/browser_output"/>
      <parameter name="verbose" value="true"/>
    </bootstrap>
    <bootstrap class="Drupal\TestTools\Extension\Dump\DebugDump">
      <parameter name="colors" value="true"/>
      <parameter name="printCaller" value="true"/>
    </bootstrap>
  </extensions>
  <testsuites>
    <!-- Unit, Kernel and Functional tests of the custom modules. JavaScript
         tests need a headless browser, which the stack does not provide. -->
    <testsuite name="custom">
      <directory>web/modules/custom</directory>
      <exclude>web/modules/custom/*/tests/src/FunctionalJavascript</exclude>
    </testsuite>
    <!-- Project-wide checks, such as the exported configuration. -->
    <testsuite name="project">
      <directory>tests/src</directory>
    </testsuite>
  </testsuites>
  <!-- Coverage is measured on the custom modules only. -->
  <source ignoreSuppressionOfDeprecations="true">
    <include>
      <directory suffix=".php">web/modules/custom/*/src</directory>
      <directory suffix=".php">web/themes/custom/*/src</directory>
    </include>
  </source>
</phpunit>
