@@ -262,7 +262,7 @@ private function assertEvent($actual, stdClass $expected, string $message)
262
262
263
263
private function assertCommandStartedEvent (CommandStartedEvent $ actual , stdClass $ expected , string $ message ): void
264
264
{
265
- Util::assertHasOnlyKeys ($ expected , ['command ' , 'commandName ' , 'databaseName ' , 'hasServiceId ' ]);
265
+ Util::assertHasOnlyKeys ($ expected , ['command ' , 'commandName ' , 'databaseName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
266
266
267
267
if (isset ($ expected ->command )) {
268
268
assertIsObject ($ expected ->command );
@@ -284,11 +284,16 @@ private function assertCommandStartedEvent(CommandStartedEvent $actual, stdClass
284
284
assertIsBool ($ expected ->hasServiceId );
285
285
assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
286
286
}
287
+
288
+ if (isset ($ expected ->hasServerConnectionId )) {
289
+ assertIsBool ($ expected ->hasServerConnectionId );
290
+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
291
+ }
287
292
}
288
293
289
294
private function assertCommandSucceededEvent (CommandSucceededEvent $ actual , stdClass $ expected , string $ message ): void
290
295
{
291
- Util::assertHasOnlyKeys ($ expected , ['reply ' , 'commandName ' , 'hasServiceId ' ]);
296
+ Util::assertHasOnlyKeys ($ expected , ['reply ' , 'commandName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
292
297
293
298
if (isset ($ expected ->reply )) {
294
299
assertIsObject ($ expected ->reply );
@@ -305,11 +310,16 @@ private function assertCommandSucceededEvent(CommandSucceededEvent $actual, stdC
305
310
assertIsBool ($ expected ->hasServiceId );
306
311
assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
307
312
}
313
+
314
+ if (isset ($ expected ->hasServerConnectionId )) {
315
+ assertIsBool ($ expected ->hasServerConnectionId );
316
+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
317
+ }
308
318
}
309
319
310
320
private function assertCommandFailedEvent (CommandFailedEvent $ actual , stdClass $ expected , string $ message ): void
311
321
{
312
- Util::assertHasOnlyKeys ($ expected , ['commandName ' , 'hasServiceId ' ]);
322
+ Util::assertHasOnlyKeys ($ expected , ['commandName ' , 'hasServiceId ' , ' hasServerConnectionId ' ]);
313
323
314
324
if (isset ($ expected ->commandName )) {
315
325
assertIsString ($ expected ->commandName );
@@ -320,6 +330,11 @@ private function assertCommandFailedEvent(CommandFailedEvent $actual, stdClass $
320
330
assertIsBool ($ expected ->hasServiceId );
321
331
assertSame ($ actual ->getServiceId () !== null , $ expected ->hasServiceId , $ message . ': hasServiceId matches ' );
322
332
}
333
+
334
+ if (isset ($ expected ->hasServerConnectionId )) {
335
+ assertIsBool ($ expected ->hasServerConnectionId );
336
+ assertSame ($ actual ->getServerConnectionId () !== null , $ expected ->hasServerConnectionId , $ message . ': hasServerConnectionId matches ' );
337
+ }
323
338
}
324
339
325
340
/** @param CommandStartedEvent|CommandSucceededEvent|CommandFailedEvent $event */
0 commit comments