<?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="Unit">
            <directory>tests/Unit</directory>
        </testsuite>
        <testsuite name="Feature">
            <directory>tests/Feature</directory>
        </testsuite>
    </testsuites>
    <source>
        <include>
            <directory>app</directory>
        </include>
    </source>
    <php>
        <!-- The suite boots the full application once per test and peaks close
             to PHP's 128M default by a margin too thin to rely on — adding
             tests tipped it over on both branches independently
             (ClientRequestAmendmentTest.php on one side, the firm-scoping
             suite on the other), and the failure mode is a "Premature end of
             PHP process" partway through that reads as a broken test rather
             than an exhausted process. Raised so a full run is reproducible
             instead of depending on how many tests exist. 512M ran out at
             ~4400 tests (6 Oct 2026), so 1G. -->
        <ini name="memory_limit" value="1G"/>
        <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"/>
        <!-- force: a DB_DATABASE already in the environment must never point the
             tests' RefreshDatabase (migrate:fresh) at the real local database —
             it wiped database.sqlite's users and sign-in tokens on 8 Oct 2026. -->
        <env name="DB_CONNECTION" value="sqlite" force="true"/>
        <env name="DB_DATABASE" value=":memory:" force="true"/>
        <!-- …and in $_SERVER, which Laravel reads first and a shell variable already fills. -->
        <server name="DB_CONNECTION" value="sqlite" force="true"/>
        <server name="DB_DATABASE" value=":memory:" force="true"/>
        <env name="DB_URL" value=""/>
        <env name="MAIL_MAILER" value="array"/>
        <!-- The config default the suite is written against; a developer's local
             .env (TMS_OPEN_ACCESS=false to see real roles) must not change it.
             Tests about RBAC set tms.open_access themselves. -->
        <env name="TMS_OPEN_ACCESS" value="true" force="true"/>
        <!-- Likewise a local CP204 redirect (TMS_CP204_EMAIL_REDIRECT_TO, the
             safety switch for testing by hand): tests about it set it themselves. -->
        <env name="TMS_CP204_EMAIL_REDIRECT_TO" value="" force="true"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="PULSE_ENABLED" value="false"/>
        <env name="TELESCOPE_ENABLED" value="false"/>
        <env name="NIGHTWATCH_ENABLED" value="false"/>
    </php>
</phpunit>
