<?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"
>
    <testsuites>
        <testsuite name="Architecture">
            <directory>tests/Architecture</directory>
        </testsuite>
        <testsuite name="Unit">
            <directory>tests/Unit</directory>
        </testsuite>
        <testsuite name="Feature">
            <directory>tests/Feature</directory>
        </testsuite>
        <!--
            Module tests live inside their module, so deleting the module
            directory removes its tests with it.
        -->
        <testsuite name="Modules">
            <directory>app/Modules/*/Tests</directory>
        </testsuite>
    </testsuites>

    <source>
        <include>
            <directory>app</directory>
        </include>
        <exclude>
            <directory>app/ModuleKernel/Console/stubs</directory>
        </exclude>
    </source>

    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="APP_MAINTENANCE_DRIVER" value="file"/>
        <env name="BCRYPT_ROUNDS" value="4"/>
        <env name="BROADCAST_CONNECTION" value="null"/>
        <env name="CACHE_STORE" value="array"/>

        <!--
            Tests run against MySQL, not SQLite.

            The production floor is MySQL 8, and the schema uses enums, fulltext
            indexes, SELECT ... FOR UPDATE and NULL-sensitive unique indexes.
            A green SQLite suite would prove nothing about any of them — that is
            exactly how "passed CI, broke on the customer's server" happens.

            Create the database once:
                CREATE DATABASE clinic_test CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
        -->
        <env name="DB_CONNECTION" value="mysql"/>
        <env name="DB_DATABASE" value="clinic_test"/>
        <env name="DB_URL" value=""/>

        <env name="MAIL_MAILER" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="MODULE_CACHE_ENABLED" value="false"/>
        <env name="LICENSE_ENFORCEMENT" value="false"/>
    </php>
</phpunit>
