<?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>
        <!-- Not RefreshDatabase-wrapped — see tests/Integration/SearchTest.php. -->
        <testsuite name="Integration">
            <directory>tests/Integration</directory>
        </testsuite>
    </testsuites>
    <source>
        <include>
            <directory>app</directory>
        </include>
    </source>
    <php>
        <env name="APP_ENV" value="testing"/>
        <!-- .env's APP_URL has a /commercedex path (production's XAMPP
             subdirectory deployment) — without this override, Pest's HTTP
             test client prepends that path to every request URI, so
             postJson('/api/...') hits the SPA catch-all route instead of
             the actual API route (405, not 404, since the catch-all is
             GET-only). -->
        <env name="APP_URL" value="http://localhost"/>
        <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"/>
        <!-- sqlite doesn't reliably support the same JSON/index behavior as
             MySQL, and every module migration targets real MySQL/MariaDB
             (chosen for universal cPanel shared-hosting compatibility) — so
             tests run against a real MySQL database too, matching prod. -->
        <env name="DB_CONNECTION" value="mysql"/>
        <env name="DB_HOST" value="127.0.0.1"/>
        <env name="DB_PORT" value="3306"/>
        <env name="DB_DATABASE" value="commercedex_laravel_test"/>
        <env name="DB_USERNAME" value="commercedex"/>
        <env name="DB_PASSWORD" value="commercedex"/>
        <env name="DB_URL" value=""/>
        <env name="MAIL_MAILER" value="array"/>
        <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>
