<?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>
        <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"/>
        <!-- TechTitans Phase 0: tests run ONLY against the dedicated TechTitans MySQL test
             database. Tests\TestCase enforces an allowlist (techtitans_*_test, listed in
             TECHTITANS_ALLOWED_DATABASES) and refuses to run otherwise — NH databases such as
             nh_pos_test / nh_pos_db and the protected NH data copy "techpos" are always rejected.
             The DB user (from .env) is least-privilege and cannot reach any other schema.
             SQLite is not used. -->
        <env name="DB_CONNECTION" value="mysql"/>
        <env name="DB_DATABASE" value="techtitans_pos_test" force="true"/>
        <env name="TECHTITANS_ALLOWED_DATABASES" value="techtitans_pos_test" force="true"/>
        <env name="DB_URL" value=""/>
        <env name="MAIL_MAILER" value="array"/>
        <!-- Matches the production queue driver (database). Queued jobs (e.g. attendance
             evaluation) are persisted, not executed inline, so afterCommit dispatch never
             runs a job synchronously inside a request's transaction. Tests that assert
             dispatch use Queue::fake(); those that need a job to run resolve+call it. -->
        <env name="QUEUE_CONNECTION" value="database"/>
        <env name="DB_QUEUE" value="techtitans-pos-test"/>
        <env name="CACHE_PREFIX" value="techtitans_pos_test_cache_"/>
        <env name="REDIS_PREFIX" value="techtitans_pos_test_"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="PULSE_ENABLED" value="false"/>
        <env name="TELESCOPE_ENABLED" value="false"/>
        <env name="NIGHTWATCH_ENABLED" value="false"/>
        <!-- AI providers are pinned to their shipped, deterministic defaults so the suite NEVER
             depends on (or bills) a real provider when a developer has real keys in .env. Tests that
             exercise the real OpenAI adapters set the driver per-test via config() and fake the HTTP
             layer, so these defaults never block them. force="true" ensures they win over .env. -->
        <env name="AI_PRODUCT_DRIVER" value="mock" force="true"/>
        <env name="AI_PRODUCT_VISION_DRIVER" value="none" force="true"/>
        <env name="AI_REPAIR_DRAFT_DRIVER" value="mock" force="true"/>
        <env name="AI_REPAIR_VISION_DRIVER" value="none" force="true"/>
        <env name="AI_REPAIR_TRANSCRIPTION_DRIVER" value="none" force="true"/>
        <!-- IPTV billing is pinned OFF for the suite so the existing deferred-path (DeferredBilling) tests
             stay deterministic and no test ever creates orders/payments implicitly. The billing-integration
             tests flip it ON per-test via config(['iptv.billing.enabled' => true]). -->
        <env name="IPTV_BILLING_ENABLED" value="false" force="true"/>
    </php>
</phpunit>
