refactor: transport agnostic examples (#131)

This commit is contained in:
Christopher Hertel 2025-11-02 18:07:43 +01:00 • committed by GitHub
commit ff26b4ff61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 157 additions and 289 deletions

View file

@ -59,6 +59,6 @@ final class HttpClientCommunicationTest extends HttpInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/http-client-communication/server.php';
return \dirname(__DIR__, 3).'/examples/client-communication/server.php';
}
}

View file

@ -45,6 +45,6 @@ final class HttpCombinedRegistrationTest extends HttpInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/http-combined-registration/server.php';
return \dirname(__DIR__, 3).'/examples/combined-registration/server.php';
}
}

View file

@ -82,6 +82,6 @@ final class HttpComplexToolSchemaTest extends HttpInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/http-complex-tool-schema/server.php';
return \dirname(__DIR__, 3).'/examples/complex-tool-schema/server.php';
}
}

View file

@ -67,6 +67,6 @@ final class HttpDiscoveryUserProfileTest extends HttpInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/http-discovery-userprofile/server.php';
return \dirname(__DIR__, 3).'/examples/discovery-userprofile/server.php';
}
}

View file

@ -21,14 +21,12 @@ abstract class HttpInspectorSnapshotTestCase extends InspectorSnapshotTestCase
protected function setUp(): void
{
parent::setUp();
$this->startServer();
}
protected function tearDown(): void
{
$this->stopServer();
parent::tearDown();
}
abstract protected function getServerScript(): string;

View file

@ -87,7 +87,7 @@ final class HttpSchemaShowcaseTest extends HttpInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/http-schema-showcase/server.php';
return \dirname(__DIR__, 3).'/examples/schema-showcase/server.php';
}
protected function normalizeTestOutput(string $output, ?string $testName = null): string

View file

@ -88,6 +88,6 @@ final class StdioCachedDiscoveryTest extends StdioInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/stdio-cached-discovery/server.php';
return \dirname(__DIR__, 3).'/examples/cached-discovery/server.php';
}
}

View file

@ -55,7 +55,7 @@ final class StdioCustomDependenciesTest extends StdioInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/stdio-custom-dependencies/server.php';
return \dirname(__DIR__, 3).'/examples/custom-dependencies/server.php';
}
protected function normalizeTestOutput(string $output, ?string $testName = null): string

View file

@ -45,6 +45,6 @@ final class StdioDiscoveryCalculatorTest extends StdioInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/stdio-discovery-calculator/server.php';
return \dirname(__DIR__, 3).'/examples/discovery-calculator/server.php';
}
}

View file

@ -50,6 +50,6 @@ final class StdioEnvVariablesTest extends StdioInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/stdio-env-variables/server.php';
return \dirname(__DIR__, 3).'/examples/env-variables/server.php';
}
}

View file

@ -77,6 +77,6 @@ final class StdioExplicitRegistrationTest extends StdioInspectorSnapshotTestCase
protected function getServerScript(): string
{
return \dirname(__DIR__, 3).'/examples/stdio-explicit-registration/server.php';
return \dirname(__DIR__, 3).'/examples/explicit-registration/server.php';
}
}