<?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="tests/bootstrap.php"
         colors="true"
         beStrictAboutOutputDuringTests="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         failOnRisky="true"
         failOnWarning="true"
         cacheDirectory=".phpunit.cache">

    <testsuites>
        <!--
            MCPClients: pure service classes — tests MUST run without WP
            bootstrap (SC-003). This suite is the canonical proof of
            FR-008 architectural purity.
        -->
        <testsuite name="mcpclients">
            <directory>tests/phpunit/MCPClients</directory>
        </testsuite>

        <!--
            OAuth (Phase 5.0 per D11): tests need WordPress for nonces,
            sessions, wp_set_current_user, register_rest_route, etc.
            Bootstrap is tests/bootstrap-wp.php (loads WP-PHPUnit). Run with
            the oauth testsuite name and override the bootstrap path via
            phpunit CLI flags when running the suite in isolation.
        -->
        <testsuite name="oauth">
            <directory>tests/phpunit/OAuth</directory>
        </testsuite>

        <!--
            CLI REST (Phase 6): tests need WP for transients, nonces,
            wp_set_current_user, register_rest_route, WP_Application_Passwords.
            Reuses Phase 5.0 bootstrap-wp.php (no new harness work). Covers
            includes/REST/ + public/Partials/ + includes/Database/CliAuthLog/Recorder.
        -->
        <testsuite name="cli-rest">
            <directory>tests/phpunit/RestCli</directory>
            <directory>tests/phpunit/FrontendAuth</directory>
        </testsuite>

        <!--
            Admin (Feature 012 + Feature 013): tests need WP for register_setting,
            $wp_registered_settings, WP_UnitTestCase. Run with
            --bootstrap tests/bootstrap-wp.php. Recursively covers subdirectories
            including tests/phpunit/Admin/ServerTabs/ added by Feature 013.
            Extended by Feature 015 to also cover tests/phpunit/Includes/AccessControl/.
        -->
        <testsuite name="admin">
            <directory>tests/phpunit/Admin</directory>
            <directory>tests/phpunit/Includes/AccessControl</directory>
        </testsuite>

        <!--
            Renderers (Feature 013): tests for public/Renderers/ layer + REST
            controller. Need WP for get_option, current_user_can,
            wp_create_nonce, WP_Application_Passwords. Run with
            --bootstrap tests/bootstrap-wp.php.
        -->
        <testsuite name="renderers">
            <directory>tests/phpunit/Public/Renderers</directory>
        </testsuite>
    </testsuites>

    <source>
        <include>
            <directory>includes</directory>
        </include>
        <exclude>
            <directory>includes/Database</directory><!-- WP-dependent; not in 004 scope -->
        </exclude>
    </source>
</phpunit>
