<?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"
         cacheDirectory=".phpunit.cache"
         colors="true"
>
    <testsuites>
        <testsuite name="Unit">
            <directory>tests/Unit</directory>
            <directory>./app-modules/*/tests/Unit</directory>
        </testsuite>
        <testsuite name="Feature">
            <directory>tests/Feature</directory>
            <directory>./app-modules/*/tests/Feature</directory>
        </testsuite>
        <testsuite name="Architecture">
            <directory>tests/Architecture</directory>
        </testsuite>
        <testsuite name="Sandbox">
            <directory>tests/Sandbox</directory>
        </testsuite>
        <testsuite name="ConsoleHost">
            <directory>tests/ConsoleHost</directory>
        </testsuite>
        <testsuite name="Integration">
            <directory>./app-modules/*/tests/Integration</directory>
        </testsuite>
        <testsuite name="Sdk">
            <directory>./sdk/generator/tests</directory>
            <directory>./sdk/php/tests</directory>
        </testsuite>
    </testsuites>
    <source>
        <include>
            <directory>app</directory>
            <directory>./app-modules/*/src</directory>
        </include>
    </source>
    <php>
        <env name="APP_ENV" value="testing" force="true"/>
        <env name="APP_MAINTENANCE_DRIVER" value="file"/>
        <!-- Cheap Argon2id for tests; production uses the defaults of config/hashing.php. -->
        <env name="HASH_DRIVER" value="argon2id" force="true"/>
        <env name="ARGON_MEMORY" value="1024" force="true"/>
        <env name="ARGON_TIME" value="1" force="true"/>
        <env name="ARGON_THREADS" value="1" force="true"/>
        <env name="BROADCAST_CONNECTION" value="null"/>
        <env name="CACHE_STORE" value="array"/>
        <env name="DB_CONNECTION" value="pgsql" force="true"/>
        <env name="DB_DATABASE" value="loyal_test" force="true"/>
        <env name="MAIL_MAILER" value="array"/>
        <!-- Fixed, non-secret keys so tests do not depend on a developer's .env. -->
        <env name="PII_ENCRYPTION_KEYS" value="k1:dGVzdC1vbmx5LXBpaS1lbmNyeXB0aW9uLWtleS0zMmI=" force="true"/>
        <env name="PII_BLIND_INDEX_KEY" value="dGVzdC1vbmx5LWJsaW5kLWluZGV4LWtleS0zMmJ5dGU=" force="true"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <!-- Webhook receivers in tests are faked HTTP clients; no DNS lookups. -->
        <env name="WEBHOOKS_ALLOW_PRIVATE_NETWORKS" value="true" force="true"/>
        <!-- Tests run in live mode whatever .env says; tests/Sandbox switch to the sandbox themselves. -->
        <env name="LOYAL_SANDBOX" value="false" force="true"/>
    </php>
</phpunit>
