Skip to content

Commit 2d778c0

Browse files
committed
Add more inspector tests for functionality tests of STDIO examples
1 parent 6100ffc commit 2d778c0

27 files changed

+288
-5
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the official PHP MCP SDK.
5+
*
6+
* A collaboration between Symfony and the PHP Foundation.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Inspector;
13+
14+
use Mcp\Tests\Inspector\InspectorSnapshotTestCase;
15+
16+
final class StdioCachedDiscoveryTest extends InspectorSnapshotTestCase
17+
{
18+
public static function provideMethods(): array
19+
{
20+
return [
21+
...parent::provideListMethods(),
22+
];
23+
}
24+
25+
protected function getServerScript(): string
26+
{
27+
return \dirname(__DIR__, 2).'/examples/stdio-cached-discovery/server.php';
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the official PHP MCP SDK.
5+
*
6+
* A collaboration between Symfony and the PHP Foundation.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Inspector;
13+
14+
use Mcp\Tests\Inspector\InspectorSnapshotTestCase;
15+
16+
final class StdioCustomDependenciesTest extends InspectorSnapshotTestCase
17+
{
18+
public static function provideMethods(): array
19+
{
20+
return [
21+
...parent::provideListMethods(),
22+
];
23+
}
24+
25+
protected function getServerScript(): string
26+
{
27+
return \dirname(__DIR__, 2).'/examples/stdio-cached-discovery/server.php';
28+
}
29+
}

tests/Inspector/StdioCalculatorExampleTest.php renamed to tests/Inspector/StdioDiscoveryCalculatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Mcp\Tests\Inspector;
1313

14-
final class StdioCalculatorExampleTest extends InspectorSnapshotTestCase
14+
final class StdioDiscoveryCalculatorTest extends InspectorSnapshotTestCase
1515
{
1616
public static function provideMethods(): array
1717
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the official PHP MCP SDK.
5+
*
6+
* A collaboration between Symfony and the PHP Foundation.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Inspector;
13+
14+
use Mcp\Tests\Inspector\InspectorSnapshotTestCase;
15+
16+
final class StdioEnvVariablesTest extends InspectorSnapshotTestCase
17+
{
18+
public static function provideMethods(): array
19+
{
20+
return [
21+
...parent::provideListMethods(),
22+
];
23+
}
24+
25+
protected function getServerScript(): string
26+
{
27+
return \dirname(__DIR__, 2).'/examples/stdio-env-variables/server.php';
28+
}
29+
}

tests/Inspector/ManualStdioExampleTest.php renamed to tests/Inspector/StdioExplicitRegistrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Mcp\Tests\Inspector\InspectorSnapshotTestCase;
1515

16-
final class ManualStdioExampleTest extends InspectorSnapshotTestCase
16+
final class StdioExplicitRegistrationTest extends InspectorSnapshotTestCase
1717
{
1818
public static function provideMethods(): array
1919
{
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
22
"prompts": []
33
}
4-
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"resources": []
3+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"tools": [
3+
{
4+
"name": "add_numbers",
5+
"inputSchema": {
6+
"type": "object",
7+
"properties": {
8+
"a": {
9+
"type": "integer"
10+
},
11+
"b": {
12+
"type": "integer"
13+
}
14+
},
15+
"required": [
16+
"a",
17+
"b"
18+
]
19+
}
20+
},
21+
{
22+
"name": "multiply_numbers",
23+
"inputSchema": {
24+
"type": "object",
25+
"properties": {
26+
"a": {
27+
"type": "integer"
28+
},
29+
"b": {
30+
"type": "integer"
31+
}
32+
},
33+
"required": [
34+
"a",
35+
"b"
36+
]
37+
}
38+
},
39+
{
40+
"name": "divide_numbers",
41+
"inputSchema": {
42+
"type": "object",
43+
"properties": {
44+
"a": {
45+
"type": "integer"
46+
},
47+
"b": {
48+
"type": "integer"
49+
}
50+
},
51+
"required": [
52+
"a",
53+
"b"
54+
]
55+
}
56+
},
57+
{
58+
"name": "power",
59+
"inputSchema": {
60+
"type": "object",
61+
"properties": {
62+
"base": {
63+
"type": "integer"
64+
},
65+
"exponent": {
66+
"type": "integer"
67+
}
68+
},
69+
"required": [
70+
"base",
71+
"exponent"
72+
]
73+
}
74+
}
75+
]
76+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"prompts": []
3+
}

0 commit comments

Comments
 (0)