<?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="tests/bootstrap.php"
         colors="true"
>
    <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>
    <php>
        <!-- force="true" is REQUIRED here: docker-compose loads .env as real
             environment variables, which otherwise shadow these test values
             (most importantly DB_DATABASE — without force the suite would run
             against, and RefreshDatabase would wipe, the dev database). -->
        <env name="APP_ENV" value="testing" force="true"/>
        <env name="APP_MAINTENANCE_DRIVER" value="file" force="true"/>
        <env name="BCRYPT_ROUNDS" value="4" force="true"/>
        <env name="CACHE_STORE" value="array" force="true"/>
        <!-- Tests run against a dedicated Postgres database so jsonb/enum schema
             matches production exactly (sqlite would diverge). -->
        <env name="DB_CONNECTION" value="pgsql" force="true"/>
        <env name="DB_DATABASE" value="chronis_test" force="true"/>
        <env name="MAIL_MAILER" value="array" force="true"/>
        <env name="OPENROUTER_API_KEY" value="test-key" force="true"/>
        <env name="PULSE_ENABLED" value="false" force="true"/>
        <env name="QUEUE_CONNECTION" value="sync" force="true"/>
        <env name="SESSION_DRIVER" value="array" force="true"/>
        <env name="TELESCOPE_ENABLED" value="false" force="true"/>
    </php>
</phpunit>
