2121#[Small]
2222class MCPServerTest extends TestCase
2323{
24- public function testRegisterToolRepository (): void
24+ public function test_register_tool_repository (): void
2525 {
2626 // Arrange
2727 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
2828 $ mockToolRepository = $ this ->createMock (ToolRepository::class);
2929
3030 $ invocations = [
3131 new ToolsListHandler ($ mockToolRepository ),
32- new ToolsCallHandler ($ mockToolRepository )
32+ new ToolsCallHandler ($ mockToolRepository ),
3333 ];
3434 $ mockProtocol ->expects ($ matcher = $ this ->exactly (count ($ invocations )))
3535 ->method ('registerRequestHandler ' )
3636 ->with ($ this ->callback (function ($ arg ) use (&$ invocations , $ matcher ) {
37- $ this ->assertEquals ($ invocations [$ matcher ->numberOfInvocations ()-1 ], $ arg );
37+ $ this ->assertEquals ($ invocations [$ matcher ->numberOfInvocations () - 1 ], $ arg );
38+
3839 return true ;
3940 }));
4041
@@ -48,7 +49,7 @@ public function testRegisterToolRepository(): void
4849 // Assert: Expectations set on the mock protocol are automatically verified.
4950 }
5051
51- public function testRegisterToolRepositoryReturnsInstance (): void
52+ public function test_register_tool_repository_returns_instance (): void
5253 {
5354 // Arrange
5455 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -65,7 +66,7 @@ public function testRegisterToolRepositoryReturnsInstance(): void
6566 $ this ->assertSame ($ instance , $ result );
6667 }
6768
68- public function testRegisterRequestHandler (): void
69+ public function test_register_request_handler (): void
6970 {
7071 // Arrange
7172 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -84,7 +85,7 @@ public function testRegisterRequestHandler(): void
8485 // Assert: Expectations set on the mock objects are automatically verified
8586 }
8687
87- public function testCreate (): void
88+ public function test_create (): void
8889 {
8990 // Arrange
9091 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -100,7 +101,7 @@ public function testCreate(): void
100101 $ this ->assertSame (['name ' => $ name , 'version ' => $ version ], $ this ->getPrivateProperty ($ server , 'serverInfo ' ));
101102 }
102103
103- public function testCreateWithCapabilities (): void
104+ public function test_create_with_capabilities (): void
104105 {
105106 // Arrange
106107 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -127,7 +128,7 @@ private function getPrivateProperty(object $object, string $property)
127128 return $ prop ->getValue ($ object );
128129 }
129130
130- public function testConnect (): void
131+ public function test_connect (): void
131132 {
132133 // Arrange
133134 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -145,7 +146,7 @@ public function testConnect(): void
145146 // Assert: Expectations set on the mock objects are automatically verified.
146147 }
147148
148- public function testDisconnect (): void
149+ public function test_disconnect (): void
149150 {
150151 // Arrange
151152 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -163,7 +164,7 @@ public function testDisconnect(): void
163164 // Assert: Expectations set on the mock objects are automatically verified.
164165 }
165166
166- public function testRegisterNotificationHandler (): void
167+ public function test_register_notification_handler (): void
167168 {
168169 // Arrange
169170 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -183,7 +184,7 @@ public function testRegisterNotificationHandler(): void
183184 // Assert: Expectations set on the mock objects are automatically verified.
184185 }
185186
186- public function testRequestMessage (): void
187+ public function test_request_message (): void
187188 {
188189 // Arrange
189190 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -208,7 +209,7 @@ public function testRequestMessage(): void
208209 * Tests that the initialize method correctly sets the client capabilities,
209210 * assigns the protocol version, and marks the server as initialized.
210211 */
211- public function testInitializeSetsCapabilitiesAndMarksInitialized (): void
212+ public function test_initialize_sets_capabilities_and_marks_initialized (): void
212213 {
213214 // Arrange
214215 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -235,7 +236,7 @@ public function testInitializeSetsCapabilitiesAndMarksInitialized(): void
235236 * Tests that the initialize method throws an exception if the server
236237 * has already been initialized.
237238 */
238- public function testInitializeThrowsWhenAlreadyInitialized (): void
239+ public function test_initialize_throws_when_already_initialized (): void
239240 {
240241 // Arrange
241242 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
@@ -259,7 +260,7 @@ public function testInitializeThrowsWhenAlreadyInitialized(): void
259260 * Tests that the initialize method returns a correctly constructed
260261 * InitializeResource object with expected values.
261262 */
262- public function testInitializeReturnsCorrectResource (): void
263+ public function test_initialize_returns_correct_resource (): void
263264 {
264265 // Arrange
265266 $ mockProtocol = $ this ->createMock (MCPProtocolInterface::class);
0 commit comments