<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true"
         cacheDirectory=".phpunit.cache"
         backupGlobals="false"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Unit">
            <directory>tests/Unit</directory>
        </testsuite>
        <testsuite name="Feature">
            <directory>tests/Feature</directory>
        </testsuite>
    </testsuites>
    <source>
        <include>
            <directory>app</directory>
        </include>
    </source>
    <!--
        The feature suites need MySQL or MariaDB. Several core migrations use DDL
        SQLite does not implement (utf8mb4 collations, ALTER ... ENUM), so the
        DB_DATABASE=":memory:" default below only works for tests that never touch
        the database - tests/Unit, in practice.

        To run tests/Feature, point the connection at a throwaway MySQL database:

            DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=mumara_testing \
              php vendor/bin/phpunit tests/Feature

        A migrate:fresh of the full schema costs minutes on every process. Once that
        database exists, migrate it once and set PHPUNIT_PREMIGRATED_DB=1 to wrap each
        test in a transaction instead (see Tests\Traits\RefreshesTestDatabase); the
        whole V2 API directory then runs in well under a minute. Re-migrate that
        database whenever a new migration lands.
    -->
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="APP_MAINTENANCE_DRIVER" value="file"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="CACHE_STORE" value="array"/>
        <env name="LOG_CHANNEL" value="single"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="MAIL_MAILER" value="array"/>
        <env name="PULSE_ENABLED" value="false"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="TELESCOPE_ENABLED" value="false"/>
    </php>
</phpunit>
