From 54dd6497236d4d2931d3a04f4af23ed0281b5eed Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Thu, 25 Sep 2025 17:27:37 +0200 Subject: [PATCH] Split testsuite for unit and inspector based tests --- .github/workflows/pipeline.yaml | 30 +++++++++++++++---- .gitignore | 1 + Makefile | 8 ++++- phpstan.dist.neon | 4 +-- phpunit.xml.dist | 7 +++-- .../InspectorSnapshotTestCase.php | 2 +- tests/Inspector/ManualStdioExampleTest.php | 29 ++++++++++++++++++ .../StdioCalculatorExampleTest.php | 5 +--- .../ManualStdioExampleTest-prompts_list.json | 15 ++++++++++ ...ManualStdioExampleTest-resources_list.json | 10 +++++++ .../ManualStdioExampleTest-tools_list.json | 20 +++++++++++++ ...dioCalculatorExampleTest-prompts_list.json | 0 ...oCalculatorExampleTest-resources_list.json | 0 ...StdioCalculatorExampleTest-tools_list.json | 0 .../Attribute/CompletionProviderFixture.php | 2 +- .../Attribute/CompletionProviderTest.php | 4 +-- .../Capability/Attribute/McpPromptTest.php | 2 +- .../Attribute/McpResourceTemplateTest.php | 2 +- .../Capability/Attribute/McpResourceTest.php | 2 +- .../Capability/Attribute/McpToolTest.php | 2 +- .../Discovery/CachedDiscovererTest.php | 2 +- .../Capability/Discovery/DiscoveryTest.php | 14 ++++----- .../Discovery/DocBlockParserTest.php | 2 +- .../Discovery/DocBlockTestFixture.php | 4 ++- .../Fixtures/DiscoverablePromptHandler.php | 4 +-- .../Fixtures/DiscoverableResourceHandler.php | 2 +- .../Fixtures/DiscoverableTemplateHandler.php | 4 +-- .../Fixtures/DiscoverableToolHandler.php | 4 +-- .../Fixtures/EnhancedCompletionHandler.php | 6 ++-- .../Fixtures/InvocablePromptFixture.php | 2 +- .../Fixtures/InvocableResourceFixture.php | 2 +- .../InvocableResourceTemplateFixture.php | 2 +- .../Fixtures/InvocableToolFixture.php | 2 +- .../Fixtures/NonDiscoverableClass.php | 2 +- .../Discovery/Fixtures/SubDir/HiddenTool.php | 2 +- .../Discovery/HandlerResolverTest.php | 6 ++-- .../Discovery/SchemaGeneratorFixture.php | 8 ++--- .../Discovery/SchemaGeneratorTest.php | 2 +- .../Discovery/SchemaValidatorTest.php | 2 +- .../Completion/EnumCompletionProviderTest.php | 8 ++--- .../Completion/ListCompletionProviderTest.php | 2 +- .../Capability/Prompt/PromptGetterTest.php | 2 +- .../Registry/RegistryProviderTest.php | 2 +- .../Capability/Registry/RegistryTest.php | 2 +- .../Resource/ResourceReaderTest.php | 2 +- .../Capability/Tool/ToolCallerTest.php | 2 +- .../Fixtures/Enum/BackedIntEnum.php | 2 +- .../Fixtures/Enum/BackedStringEnum.php | 2 +- .../{ => Unit}/Fixtures/Enum/PriorityEnum.php | 2 +- tests/{ => Unit}/Fixtures/Enum/StatusEnum.php | 2 +- tests/{ => Unit}/Fixtures/Enum/UnitEnum.php | 2 +- tests/{ => Unit}/JsonRpc/HandlerTest.php | 2 +- .../{ => Unit}/JsonRpc/MessageFactoryTest.php | 2 +- .../Schema/JsonRpc/NotificationTest.php | 2 +- .../{ => Unit}/Schema/JsonRpc/RequestTest.php | 2 +- .../Schema/ServerCapabilitiesTest.php | 2 +- .../RequestHandler/CallToolHandlerTest.php | 2 +- .../RequestHandler/GetPromptHandlerTest.php | 2 +- .../RequestHandler/ListPromptsHandlerTest.php | 2 +- .../ListResourcesHandlerTest.php | 2 +- .../RequestHandler/ListToolsHandlerTest.php | 2 +- .../Server/RequestHandler/PingHandlerTest.php | 2 +- .../ReadResourceHandlerTest.php | 2 +- tests/{ => Unit}/ServerTest.php | 2 +- 64 files changed, 188 insertions(+), 85 deletions(-) rename tests/{Example => Inspector}/InspectorSnapshotTestCase.php (98%) create mode 100644 tests/Inspector/ManualStdioExampleTest.php rename tests/{Example => Inspector}/StdioCalculatorExampleTest.php (87%) create mode 100644 tests/Inspector/snapshots/ManualStdioExampleTest-prompts_list.json create mode 100644 tests/Inspector/snapshots/ManualStdioExampleTest-resources_list.json create mode 100644 tests/Inspector/snapshots/ManualStdioExampleTest-tools_list.json rename tests/{Example => Inspector}/snapshots/StdioCalculatorExampleTest-prompts_list.json (100%) rename tests/{Example => Inspector}/snapshots/StdioCalculatorExampleTest-resources_list.json (100%) rename tests/{Example => Inspector}/snapshots/StdioCalculatorExampleTest-tools_list.json (100%) rename tests/{ => Unit}/Capability/Attribute/CompletionProviderFixture.php (94%) rename tests/{ => Unit}/Capability/Attribute/CompletionProviderTest.php (96%) rename tests/{ => Unit}/Capability/Attribute/McpPromptTest.php (96%) rename tests/{ => Unit}/Capability/Attribute/McpResourceTemplateTest.php (97%) rename tests/{ => Unit}/Capability/Attribute/McpResourceTest.php (97%) rename tests/{ => Unit}/Capability/Attribute/McpToolTest.php (96%) rename tests/{ => Unit}/Capability/Discovery/CachedDiscovererTest.php (98%) rename tests/{ => Unit}/Capability/Discovery/DiscoveryTest.php (94%) rename tests/{ => Unit}/Capability/Discovery/DocBlockParserTest.php (99%) rename tests/{ => Unit}/Capability/Discovery/DocBlockTestFixture.php (96%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/DiscoverablePromptHandler.php (91%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/DiscoverableResourceHandler.php (95%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/DiscoverableTemplateHandler.php (92%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/DiscoverableToolHandler.php (94%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/EnhancedCompletionHandler.php (91%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/InvocablePromptFixture.php (90%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/InvocableResourceFixture.php (90%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/InvocableResourceTemplateFixture.php (91%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/InvocableToolFixture.php (90%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/NonDiscoverableClass.php (90%) rename tests/{ => Unit}/Capability/Discovery/Fixtures/SubDir/HiddenTool.php (86%) rename tests/{ => Unit}/Capability/Discovery/HandlerResolverTest.php (97%) rename tests/{ => Unit}/Capability/Discovery/SchemaGeneratorFixture.php (98%) rename tests/{ => Unit}/Capability/Discovery/SchemaGeneratorTest.php (99%) rename tests/{ => Unit}/Capability/Discovery/SchemaValidatorTest.php (99%) rename tests/{ => Unit}/Capability/Prompt/Completion/EnumCompletionProviderTest.php (92%) rename tests/{ => Unit}/Capability/Prompt/Completion/ListCompletionProviderTest.php (97%) rename tests/{ => Unit}/Capability/Prompt/PromptGetterTest.php (99%) rename tests/{ => Unit}/Capability/Registry/RegistryProviderTest.php (99%) rename tests/{ => Unit}/Capability/Registry/RegistryTest.php (99%) rename tests/{ => Unit}/Capability/Resource/ResourceReaderTest.php (99%) rename tests/{ => Unit}/Capability/Tool/ToolCallerTest.php (99%) rename tests/{ => Unit}/Fixtures/Enum/BackedIntEnum.php (89%) rename tests/{ => Unit}/Fixtures/Enum/BackedStringEnum.php (89%) rename tests/{ => Unit}/Fixtures/Enum/PriorityEnum.php (89%) rename tests/{ => Unit}/Fixtures/Enum/StatusEnum.php (90%) rename tests/{ => Unit}/Fixtures/Enum/UnitEnum.php (88%) rename tests/{ => Unit}/JsonRpc/HandlerTest.php (99%) rename tests/{ => Unit}/JsonRpc/MessageFactoryTest.php (98%) rename tests/{ => Unit}/Schema/JsonRpc/NotificationTest.php (97%) rename tests/{ => Unit}/Schema/JsonRpc/RequestTest.php (97%) rename tests/{ => Unit}/Schema/ServerCapabilitiesTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/CallToolHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/GetPromptHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/ListPromptsHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/ListResourcesHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/ListToolsHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/PingHandlerTest.php (99%) rename tests/{ => Unit}/Server/RequestHandler/ReadResourceHandlerTest.php (99%) rename tests/{ => Unit}/ServerTest.php (98%) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 98e173a3..d7fd0de1 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -6,7 +6,7 @@ permissions: pull-requests: write jobs: - tests: + unit: runs-on: ubuntu-latest strategy: matrix: @@ -22,16 +22,36 @@ jobs: php-version: ${{ matrix.php }} coverage: "none" - - name: Composer Validation - run: composer validate --strict - - name: Install Composer uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" - name: Tests - run: vendor/bin/phpunit --exclude-group inspector + run: vendor/bin/phpunit --testsuite=unit + + inspector: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + coverage: "none" + + - name: Setup Node + uses: actions/setup-node@v5 + with: + node-version: '22' + + - name: Install Composer + uses: "ramsey/composer-install@v3" + + - name: Tests + run: vendor/bin/phpunit --testsuite=inspector qa: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 825fe72f..dda65497 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .phpunit.cache .php-cs-fixer.cache composer.lock +coverage vendor examples/**/dev.log examples/**/sessions diff --git a/Makefile b/Makefile index 12e4f321..119e9d40 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,14 @@ phpstan: tests: vendor/bin/phpunit +unit-tests: + vendor/bin/phpunit --testsuite=unit + +inspector-tests: + vendor/bin/phpunit --testsuite=inspector + coverage: - XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage + XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite=unit --coverage-html=coverage ci: ci-stable diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 108b384b..17f4c3b0 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -9,8 +9,8 @@ parameters: - tests/ excludePaths: - examples/cli/vendor/* (?) - - tests/Capability/Discovery/Fixtures/ - - tests/Capability/Discovery/SchemaGeneratorFixture.php + - tests/Unit/Capability/Discovery/Fixtures/ + - tests/Unit/Capability/Discovery/SchemaGeneratorFixture.php treatPhpDocTypesAsCertain: false ignoreErrors: - diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1dfe524e..d5adf9e1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,8 +9,11 @@ failOnWarning="true"> - - tests + + tests/Unit + + + tests/Inspector diff --git a/tests/Example/InspectorSnapshotTestCase.php b/tests/Inspector/InspectorSnapshotTestCase.php similarity index 98% rename from tests/Example/InspectorSnapshotTestCase.php rename to tests/Inspector/InspectorSnapshotTestCase.php index fae80d51..bca8179f 100644 --- a/tests/Example/InspectorSnapshotTestCase.php +++ b/tests/Inspector/InspectorSnapshotTestCase.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Example; +namespace Mcp\Tests\Inspector; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Inspector/ManualStdioExampleTest.php b/tests/Inspector/ManualStdioExampleTest.php new file mode 100644 index 00000000..affe4462 --- /dev/null +++ b/tests/Inspector/ManualStdioExampleTest.php @@ -0,0 +1,29 @@ +expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invokable handler class "Mcp\\Tests\\Capability\\Discovery\\NonInvokableClass" must have a public "__invoke" method.'); + $this->expectExceptionMessage('Invokable handler class "Mcp\Tests\Unit\Capability\Discovery\NonInvokableClass" must have a public "__invoke" method.'); HandlerResolver::resolve(NonInvokableClass::class); } @@ -129,7 +129,7 @@ public function testThrowsForDestructorAsHandler() public function testThrowsForAbstractMethodHandler() { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Handler method "Mcp\Tests\Capability\Discovery\AbstractHandlerClass::abstractMethod" must be abstract.'); + $this->expectExceptionMessage('Handler method "Mcp\Tests\Unit\Capability\Discovery\AbstractHandlerClass::abstractMethod" must be abstract.'); HandlerResolver::resolve([AbstractHandlerClass::class, 'abstractMethod']); } diff --git a/tests/Capability/Discovery/SchemaGeneratorFixture.php b/tests/Unit/Capability/Discovery/SchemaGeneratorFixture.php similarity index 98% rename from tests/Capability/Discovery/SchemaGeneratorFixture.php rename to tests/Unit/Capability/Discovery/SchemaGeneratorFixture.php index 736487ed..5a7fcaeb 100644 --- a/tests/Capability/Discovery/SchemaGeneratorFixture.php +++ b/tests/Unit/Capability/Discovery/SchemaGeneratorFixture.php @@ -9,12 +9,12 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Discovery; +namespace Mcp\Tests\Unit\Capability\Discovery; use Mcp\Capability\Attribute\Schema; -use Mcp\Tests\Fixtures\Enum\BackedIntEnum; -use Mcp\Tests\Fixtures\Enum\BackedStringEnum; -use Mcp\Tests\Fixtures\Enum\UnitEnum; +use Mcp\Tests\Unit\Fixtures\Enum\BackedIntEnum; +use Mcp\Tests\Unit\Fixtures\Enum\BackedStringEnum; +use Mcp\Tests\Unit\Fixtures\Enum\UnitEnum; /** * Comprehensive fixture for testing SchemaGenerator with various scenarios. diff --git a/tests/Capability/Discovery/SchemaGeneratorTest.php b/tests/Unit/Capability/Discovery/SchemaGeneratorTest.php similarity index 99% rename from tests/Capability/Discovery/SchemaGeneratorTest.php rename to tests/Unit/Capability/Discovery/SchemaGeneratorTest.php index 19fb2288..4cbfce52 100644 --- a/tests/Capability/Discovery/SchemaGeneratorTest.php +++ b/tests/Unit/Capability/Discovery/SchemaGeneratorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Discovery; +namespace Mcp\Tests\Unit\Capability\Discovery; use Mcp\Capability\Discovery\DocBlockParser; use Mcp\Capability\Discovery\SchemaGenerator; diff --git a/tests/Capability/Discovery/SchemaValidatorTest.php b/tests/Unit/Capability/Discovery/SchemaValidatorTest.php similarity index 99% rename from tests/Capability/Discovery/SchemaValidatorTest.php rename to tests/Unit/Capability/Discovery/SchemaValidatorTest.php index b1c8a705..417ddbde 100644 --- a/tests/Capability/Discovery/SchemaValidatorTest.php +++ b/tests/Unit/Capability/Discovery/SchemaValidatorTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Discovery; +namespace Mcp\Tests\Unit\Capability\Discovery; use Mcp\Capability\Attribute\Schema; use Mcp\Capability\Discovery\SchemaValidator; diff --git a/tests/Capability/Prompt/Completion/EnumCompletionProviderTest.php b/tests/Unit/Capability/Prompt/Completion/EnumCompletionProviderTest.php similarity index 92% rename from tests/Capability/Prompt/Completion/EnumCompletionProviderTest.php rename to tests/Unit/Capability/Prompt/Completion/EnumCompletionProviderTest.php index 7d568f3c..8d81d0e6 100644 --- a/tests/Capability/Prompt/Completion/EnumCompletionProviderTest.php +++ b/tests/Unit/Capability/Prompt/Completion/EnumCompletionProviderTest.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Prompt\Completion; +namespace Mcp\Tests\Unit\Capability\Prompt\Completion; use Mcp\Capability\Prompt\Completion\EnumCompletionProvider; use Mcp\Exception\InvalidArgumentException; -use Mcp\Tests\Fixtures\Enum\PriorityEnum; -use Mcp\Tests\Fixtures\Enum\StatusEnum; -use Mcp\Tests\Fixtures\Enum\UnitEnum; +use Mcp\Tests\Unit\Fixtures\Enum\PriorityEnum; +use Mcp\Tests\Unit\Fixtures\Enum\StatusEnum; +use Mcp\Tests\Unit\Fixtures\Enum\UnitEnum; use PHPUnit\Framework\TestCase; class EnumCompletionProviderTest extends TestCase diff --git a/tests/Capability/Prompt/Completion/ListCompletionProviderTest.php b/tests/Unit/Capability/Prompt/Completion/ListCompletionProviderTest.php similarity index 97% rename from tests/Capability/Prompt/Completion/ListCompletionProviderTest.php rename to tests/Unit/Capability/Prompt/Completion/ListCompletionProviderTest.php index b5def78d..80c58100 100644 --- a/tests/Capability/Prompt/Completion/ListCompletionProviderTest.php +++ b/tests/Unit/Capability/Prompt/Completion/ListCompletionProviderTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Prompt\Completion; +namespace Mcp\Tests\Unit\Capability\Prompt\Completion; use Mcp\Capability\Prompt\Completion\ListCompletionProvider; use PHPUnit\Framework\TestCase; diff --git a/tests/Capability/Prompt/PromptGetterTest.php b/tests/Unit/Capability/Prompt/PromptGetterTest.php similarity index 99% rename from tests/Capability/Prompt/PromptGetterTest.php rename to tests/Unit/Capability/Prompt/PromptGetterTest.php index 46bee1cf..fe68ddcb 100644 --- a/tests/Capability/Prompt/PromptGetterTest.php +++ b/tests/Unit/Capability/Prompt/PromptGetterTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Prompt; +namespace Mcp\Tests\Unit\Capability\Prompt; use Mcp\Capability\Prompt\Completion\EnumCompletionProvider; use Mcp\Capability\Prompt\PromptGetter; diff --git a/tests/Capability/Registry/RegistryProviderTest.php b/tests/Unit/Capability/Registry/RegistryProviderTest.php similarity index 99% rename from tests/Capability/Registry/RegistryProviderTest.php rename to tests/Unit/Capability/Registry/RegistryProviderTest.php index 604311be..b1eaa857 100644 --- a/tests/Capability/Registry/RegistryProviderTest.php +++ b/tests/Unit/Capability/Registry/RegistryProviderTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Registry; +namespace Mcp\Tests\Unit\Capability\Registry; use Mcp\Capability\Registry; use Mcp\Capability\Registry\PromptReference; diff --git a/tests/Capability/Registry/RegistryTest.php b/tests/Unit/Capability/Registry/RegistryTest.php similarity index 99% rename from tests/Capability/Registry/RegistryTest.php rename to tests/Unit/Capability/Registry/RegistryTest.php index 14548b63..91ce0f71 100644 --- a/tests/Capability/Registry/RegistryTest.php +++ b/tests/Unit/Capability/Registry/RegistryTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Registry; +namespace Mcp\Tests\Unit\Capability\Registry; use Mcp\Capability\Prompt\Completion\EnumCompletionProvider; use Mcp\Capability\Registry; diff --git a/tests/Capability/Resource/ResourceReaderTest.php b/tests/Unit/Capability/Resource/ResourceReaderTest.php similarity index 99% rename from tests/Capability/Resource/ResourceReaderTest.php rename to tests/Unit/Capability/Resource/ResourceReaderTest.php index 2206ce92..73c967ff 100644 --- a/tests/Capability/Resource/ResourceReaderTest.php +++ b/tests/Unit/Capability/Resource/ResourceReaderTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Resource; +namespace Mcp\Tests\Unit\Capability\Resource; use Mcp\Capability\Registry\ReferenceHandlerInterface; use Mcp\Capability\Registry\ReferenceProviderInterface; diff --git a/tests/Capability/Tool/ToolCallerTest.php b/tests/Unit/Capability/Tool/ToolCallerTest.php similarity index 99% rename from tests/Capability/Tool/ToolCallerTest.php rename to tests/Unit/Capability/Tool/ToolCallerTest.php index 8894dc93..889c2ec4 100644 --- a/tests/Capability/Tool/ToolCallerTest.php +++ b/tests/Unit/Capability/Tool/ToolCallerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Capability\Tool; +namespace Mcp\Tests\Unit\Capability\Tool; use Mcp\Capability\Registry\ReferenceHandlerInterface; use Mcp\Capability\Registry\ReferenceProviderInterface; diff --git a/tests/Fixtures/Enum/BackedIntEnum.php b/tests/Unit/Fixtures/Enum/BackedIntEnum.php similarity index 89% rename from tests/Fixtures/Enum/BackedIntEnum.php rename to tests/Unit/Fixtures/Enum/BackedIntEnum.php index 32fa8ca8..75079c77 100644 --- a/tests/Fixtures/Enum/BackedIntEnum.php +++ b/tests/Unit/Fixtures/Enum/BackedIntEnum.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Fixtures\Enum; +namespace Mcp\Tests\Unit\Fixtures\Enum; enum BackedIntEnum: int { diff --git a/tests/Fixtures/Enum/BackedStringEnum.php b/tests/Unit/Fixtures/Enum/BackedStringEnum.php similarity index 89% rename from tests/Fixtures/Enum/BackedStringEnum.php rename to tests/Unit/Fixtures/Enum/BackedStringEnum.php index ae5cbcaa..85961949 100644 --- a/tests/Fixtures/Enum/BackedStringEnum.php +++ b/tests/Unit/Fixtures/Enum/BackedStringEnum.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Fixtures\Enum; +namespace Mcp\Tests\Unit\Fixtures\Enum; enum BackedStringEnum: string { diff --git a/tests/Fixtures/Enum/PriorityEnum.php b/tests/Unit/Fixtures/Enum/PriorityEnum.php similarity index 89% rename from tests/Fixtures/Enum/PriorityEnum.php rename to tests/Unit/Fixtures/Enum/PriorityEnum.php index 5bf466e6..2d3c3706 100644 --- a/tests/Fixtures/Enum/PriorityEnum.php +++ b/tests/Unit/Fixtures/Enum/PriorityEnum.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Fixtures\Enum; +namespace Mcp\Tests\Unit\Fixtures\Enum; enum PriorityEnum: int { diff --git a/tests/Fixtures/Enum/StatusEnum.php b/tests/Unit/Fixtures/Enum/StatusEnum.php similarity index 90% rename from tests/Fixtures/Enum/StatusEnum.php rename to tests/Unit/Fixtures/Enum/StatusEnum.php index 66bfce32..0387d44a 100644 --- a/tests/Fixtures/Enum/StatusEnum.php +++ b/tests/Unit/Fixtures/Enum/StatusEnum.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Fixtures\Enum; +namespace Mcp\Tests\Unit\Fixtures\Enum; enum StatusEnum: string { diff --git a/tests/Fixtures/Enum/UnitEnum.php b/tests/Unit/Fixtures/Enum/UnitEnum.php similarity index 88% rename from tests/Fixtures/Enum/UnitEnum.php rename to tests/Unit/Fixtures/Enum/UnitEnum.php index a751e12c..65947683 100644 --- a/tests/Fixtures/Enum/UnitEnum.php +++ b/tests/Unit/Fixtures/Enum/UnitEnum.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Fixtures\Enum; +namespace Mcp\Tests\Unit\Fixtures\Enum; enum UnitEnum { diff --git a/tests/JsonRpc/HandlerTest.php b/tests/Unit/JsonRpc/HandlerTest.php similarity index 99% rename from tests/JsonRpc/HandlerTest.php rename to tests/Unit/JsonRpc/HandlerTest.php index 20781def..2535449a 100644 --- a/tests/JsonRpc/HandlerTest.php +++ b/tests/Unit/JsonRpc/HandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\JsonRpc; +namespace Mcp\Tests\Unit\JsonRpc; use Mcp\JsonRpc\Handler; use Mcp\JsonRpc\MessageFactory; diff --git a/tests/JsonRpc/MessageFactoryTest.php b/tests/Unit/JsonRpc/MessageFactoryTest.php similarity index 98% rename from tests/JsonRpc/MessageFactoryTest.php rename to tests/Unit/JsonRpc/MessageFactoryTest.php index 9f43aad6..12d2b233 100644 --- a/tests/JsonRpc/MessageFactoryTest.php +++ b/tests/Unit/JsonRpc/MessageFactoryTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\JsonRpc; +namespace Mcp\Tests\Unit\JsonRpc; use Mcp\Exception\InvalidInputMessageException; use Mcp\JsonRpc\MessageFactory; diff --git a/tests/Schema/JsonRpc/NotificationTest.php b/tests/Unit/Schema/JsonRpc/NotificationTest.php similarity index 97% rename from tests/Schema/JsonRpc/NotificationTest.php rename to tests/Unit/Schema/JsonRpc/NotificationTest.php index c2ab0fe5..af98671c 100644 --- a/tests/Schema/JsonRpc/NotificationTest.php +++ b/tests/Unit/Schema/JsonRpc/NotificationTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Schema\JsonRpc; +namespace Mcp\Tests\Unit\Schema\JsonRpc; use Mcp\Schema\JsonRpc\Notification; use PHPUnit\Framework\TestCase; diff --git a/tests/Schema/JsonRpc/RequestTest.php b/tests/Unit/Schema/JsonRpc/RequestTest.php similarity index 97% rename from tests/Schema/JsonRpc/RequestTest.php rename to tests/Unit/Schema/JsonRpc/RequestTest.php index 279d0953..86e01d3d 100644 --- a/tests/Schema/JsonRpc/RequestTest.php +++ b/tests/Unit/Schema/JsonRpc/RequestTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Schema\JsonRpc; +namespace Mcp\Tests\Unit\Schema\JsonRpc; use Mcp\Schema\JsonRpc\Request; use PHPUnit\Framework\TestCase; diff --git a/tests/Schema/ServerCapabilitiesTest.php b/tests/Unit/Schema/ServerCapabilitiesTest.php similarity index 99% rename from tests/Schema/ServerCapabilitiesTest.php rename to tests/Unit/Schema/ServerCapabilitiesTest.php index 3a9f2b99..9d1562c1 100644 --- a/tests/Schema/ServerCapabilitiesTest.php +++ b/tests/Unit/Schema/ServerCapabilitiesTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Schema; +namespace Mcp\Tests\Unit\Schema; use Mcp\Schema\ServerCapabilities; use PHPUnit\Framework\TestCase; diff --git a/tests/Server/RequestHandler/CallToolHandlerTest.php b/tests/Unit/Server/RequestHandler/CallToolHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/CallToolHandlerTest.php rename to tests/Unit/Server/RequestHandler/CallToolHandlerTest.php index 1b2187ff..ea0b8c17 100644 --- a/tests/Server/RequestHandler/CallToolHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/CallToolHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Tool\ToolCallerInterface; use Mcp\Exception\ToolCallException; diff --git a/tests/Server/RequestHandler/GetPromptHandlerTest.php b/tests/Unit/Server/RequestHandler/GetPromptHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/GetPromptHandlerTest.php rename to tests/Unit/Server/RequestHandler/GetPromptHandlerTest.php index 120b0e08..e941ef41 100644 --- a/tests/Server/RequestHandler/GetPromptHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/GetPromptHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Prompt\PromptGetterInterface; use Mcp\Exception\PromptGetException; diff --git a/tests/Server/RequestHandler/ListPromptsHandlerTest.php b/tests/Unit/Server/RequestHandler/ListPromptsHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/ListPromptsHandlerTest.php rename to tests/Unit/Server/RequestHandler/ListPromptsHandlerTest.php index b10d3e56..c3079e2d 100644 --- a/tests/Server/RequestHandler/ListPromptsHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/ListPromptsHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Registry; use Mcp\Exception\InvalidCursorException; diff --git a/tests/Server/RequestHandler/ListResourcesHandlerTest.php b/tests/Unit/Server/RequestHandler/ListResourcesHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/ListResourcesHandlerTest.php rename to tests/Unit/Server/RequestHandler/ListResourcesHandlerTest.php index 13044a73..f1b6a6ca 100644 --- a/tests/Server/RequestHandler/ListResourcesHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/ListResourcesHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Registry; use Mcp\Exception\InvalidCursorException; diff --git a/tests/Server/RequestHandler/ListToolsHandlerTest.php b/tests/Unit/Server/RequestHandler/ListToolsHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/ListToolsHandlerTest.php rename to tests/Unit/Server/RequestHandler/ListToolsHandlerTest.php index 85ae9b63..a7e4902c 100644 --- a/tests/Server/RequestHandler/ListToolsHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/ListToolsHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Registry; use Mcp\Exception\InvalidCursorException; diff --git a/tests/Server/RequestHandler/PingHandlerTest.php b/tests/Unit/Server/RequestHandler/PingHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/PingHandlerTest.php rename to tests/Unit/Server/RequestHandler/PingHandlerTest.php index 3be1176b..6c75e74a 100644 --- a/tests/Server/RequestHandler/PingHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/PingHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Schema\JsonRpc\Request; use Mcp\Schema\JsonRpc\Response; diff --git a/tests/Server/RequestHandler/ReadResourceHandlerTest.php b/tests/Unit/Server/RequestHandler/ReadResourceHandlerTest.php similarity index 99% rename from tests/Server/RequestHandler/ReadResourceHandlerTest.php rename to tests/Unit/Server/RequestHandler/ReadResourceHandlerTest.php index a78aa853..ab6c8fb3 100644 --- a/tests/Server/RequestHandler/ReadResourceHandlerTest.php +++ b/tests/Unit/Server/RequestHandler/ReadResourceHandlerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests\Server\RequestHandler; +namespace Mcp\Tests\Unit\Server\RequestHandler; use Mcp\Capability\Resource\ResourceReaderInterface; use Mcp\Exception\ResourceNotFoundException; diff --git a/tests/ServerTest.php b/tests/Unit/ServerTest.php similarity index 98% rename from tests/ServerTest.php rename to tests/Unit/ServerTest.php index 046583d1..34c04efc 100644 --- a/tests/ServerTest.php +++ b/tests/Unit/ServerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Mcp\Tests; +namespace Mcp\Tests\Unit; use Mcp\JsonRpc\Handler; use Mcp\Server;