<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
         colors="true"
         failOnDeprecation="true"
         failOnNotice="true"
         failOnWarning="true"
         bootstrap="tests/bootstrap.php"
         cacheDirectory=".phpunit.cache"
>
    <php>
        <ini name="display_errors" value="1" />
        <ini name="error_reporting" value="-1" />
        <server name="APP_ENV" value="test" force="true" />
        <server name="SHELL_VERBOSITY" value="-1" />
        <server name="KERNEL_CLASS" value="App\Kernel" />

        <!-- ###+ symfony/framework-bundle ### -->
        <!-- APP_ENV est defini uniquement via <server force="true"> ci-dessus.
             Ne PAS re-declarer ici en <env> : une ligne redondante mene
             directement au bug ou un dev met "dev" en pensant que <server>
             gere tout, puis supprime <server> ensuite et <env> prend le
             dessus silencieusement (cf. cc8d5 du fix pre-existant). -->
        <env name="APP_SECRET" value=""/>
        <env name="APP_SHARE_DIR" value="var/share"/>
        <!-- ###- symfony/framework-bundle ### -->

        <!-- ###+ symfony/routing ### -->
        <!-- Configure how to generate URLs in non-HTTP contexts, such as CLI commands. -->
        <!-- See https://symfony.com/doc/current/routing.html#generating-urls-in-commands -->
        <env name="DEFAULT_URI" value="http://localhost"/>
        <!-- ###- symfony/routing ### -->

        <!-- ###+ doctrine/doctrine-bundle ### -->
        <!-- Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -->
        <!-- IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -->
        <!--  -->
        <!-- DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db" -->
        <!-- DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" -->
        <!-- DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -->
        <env name="DATABASE_URL" value="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&amp;charset=utf8"/>
        <!-- ###- doctrine/doctrine-bundle ### -->

        <!-- ###+ lexik/jwt-authentication-bundle ### -->
        <env name="JWT_SECRET_KEY" value="%kernel.project_dir%/config/jwt/private.pem"/>
        <env name="JWT_PUBLIC_KEY" value="%kernel.project_dir%/config/jwt/public.pem"/>
        <!-- Doit correspondre a la passphrase utilisee lors de la generation
             des cles JWT (config/jwt/*.pem). En local dev, c'est la valeur
             par defaut "change_me_in_env_local" du .env (override possible
             via .env.test.local si les cles ont ete regenerees autrement). -->
        <env name="JWT_PASSPHRASE" value="change_me_in_env_local"/>
        <!-- ###- lexik/jwt-authentication-bundle ### -->

        <!-- ###+ nelmio/cors-bundle ### -->
        <env name="CORS_ALLOW_ORIGIN" value="'^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'"/>
        <!-- ###- nelmio/cors-bundle ### -->
    </php>

    <testsuites>
        <testsuite name="Project Test Suite">
            <directory>tests</directory>
        </testsuite>
    </testsuites>

    <source ignoreSuppressionOfDeprecations="true"
            ignoreIndirectDeprecations="true"
            restrictNotices="true"
            restrictWarnings="true"
    >
        <include>
            <directory>src</directory>
        </include>

        <deprecationTrigger>
            <method>Doctrine\Deprecations\Deprecation::trigger</method>
            <method>Doctrine\Deprecations\Deprecation::delegateTriggerToBackend</method>
            <function>trigger_deprecation</function>
        </deprecationTrigger>
    </source>

    <extensions>
    </extensions>
</phpunit>
