@@ -262,7 +262,7 @@ private function assertEvent($actual, stdClass $expected, string $message)
262262
263263 private function assertCommandStartedEvent (CommandStartedEvent $ actual , stdClass $ expected , string $ message ): void
264264 {
265- Util::assertHasOnlyKeys ($ expected , ['command ' , 'commandName ' , 'databaseName ' , 'hasServiceId ' ]);
265+ Util::assertHasOnlyKeys ($ expected , ['command ' , 'commandName ' , 'databaseName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
266266
267267 if (isset ($ expected ->command )) {
268268 assertIsObject ($ expected ->command );
@@ -284,11 +284,16 @@ private function assertCommandStartedEvent(CommandStartedEvent $actual, stdClass
284284 assertIsBool ($ expected ->hasServiceId );
285285 assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
286286 }
287+
288+ if (isset ($ expected ->hasServerConnectionId )) {
289+ assertIsBool ($ expected ->hasServerConnectionId );
290+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
291+ }
287292 }
288293
289294 private function assertCommandSucceededEvent (CommandSucceededEvent $ actual , stdClass $ expected , string $ message ): void
290295 {
291- Util::assertHasOnlyKeys ($ expected , ['reply ' , 'commandName ' , 'hasServiceId ' ]);
296+ Util::assertHasOnlyKeys ($ expected , ['reply ' , 'commandName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
292297
293298 if (isset ($ expected ->reply )) {
294299 assertIsObject ($ expected ->reply );
@@ -305,11 +310,16 @@ private function assertCommandSucceededEvent(CommandSucceededEvent $actual, stdC
305310 assertIsBool ($ expected ->hasServiceId );
306311 assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
307312 }
313+
314+ if (isset ($ expected ->hasServerConnectionId )) {
315+ assertIsBool ($ expected ->hasServerConnectionId );
316+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
317+ }
308318 }
309319
310320 private function assertCommandFailedEvent (CommandFailedEvent $ actual , stdClass $ expected , string $ message ): void
311321 {
312- Util::assertHasOnlyKeys ($ expected , ['commandName ' , 'hasServiceId ' ]);
322+ Util::assertHasOnlyKeys ($ expected , ['commandName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
313323
314324 if (isset ($ expected ->commandName )) {
315325 assertIsString ($ expected ->commandName );
@@ -320,6 +330,11 @@ private function assertCommandFailedEvent(CommandFailedEvent $actual, stdClass $
320330 assertIsBool ($ expected ->hasServiceId );
321331 assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
322332 }
333+
334+ if (isset ($ expected ->hasServerConnectionId )) {
335+ assertIsBool ($ expected ->hasServerConnectionId );
336+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
337+ }
323338 }
324339
325340 /** @param CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent $event */
0 commit comments