<?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"
         cacheDirectory=".phpunit.cache"
         displayDetailsOnPhpunitDeprecations="true"
         failOnRisky="true"
         failOnWarning="true">

    <!--
        Four suites, matching the testing table in the master prompt. They are
        separate because they have different costs and different failure
        meanings, and CI runs them as distinct gates:

          Unit         pure domain logic, no database. Fast, run constantly.
          Contract     every response validated against contracts/openapi.yaml.
          Feature      HTTP endpoints through the framework.
          Integration  real MySQL: stored procedures, transactions, tenant
                       isolation, concurrency. Slowest, and the only place the
                       seat-contention guarantees can actually be proven.
    -->
    <testsuites>
        <testsuite name="Unit">
            <directory>tests/Unit</directory>
        </testsuite>
        <testsuite name="Contract">
            <directory>tests/Contract</directory>
        </testsuite>
        <testsuite name="Feature">
            <directory>tests/Feature</directory>
        </testsuite>
        <testsuite name="Integration">
            <directory>tests/Integration</directory>
        </testsuite>
    </testsuites>

    <source>
        <include>
            <directory>app</directory>
            <directory>Modules</directory>
        </include>
    </source>

    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="APP_MAINTENANCE_DRIVER" value="file"/>
        <env name="BCRYPT_ROUNDS" value="4"/>

        <!--
            A real MySQL schema, not :memory: SQLite.

            SQLite cannot execute the stored procedures that own seat inventory,
            document numbering and journal posting (ADR-005), and it silently
            accepts things MySQL rejects in strict mode. A suite that passes on
            SQLite and fails in production is worse than no suite.
        -->
        <env name="DB_CONNECTION" value="mysql"/>
        <env name="DB_DATABASE" value="tourism_test"/>

        <env name="CACHE_STORE" value="array"/>
        <env name="QUEUE_CONNECTION" value="sync"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="MAIL_MAILER" value="array"/>
        <env name="FILESYSTEM_DISK" value="local"/>

        <env name="PULSE_ENABLED" value="false"/>
        <env name="TELESCOPE_ENABLED" value="false"/>
    </php>
</phpunit>
