11--TEST--
22PHPC-1152: Command cursors should use the same session for getMore and killCursors (implicit)
33--SKIPIF--
4- <?php if (PHP_INT_SIZE !== 8 ) { die ("skip Can't represent 64-bit ints on a 32-bit platform " ); } ?>
54<?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
65<?php skip_if_not_libmongoc_crypto (); ?>
76<?php skip_if_not_live (); ?>
@@ -74,7 +73,7 @@ class Test implements MongoDB\Driver\Monitoring\CommandSubscriber
7473 }
7574
7675 if ($ event ->getCommandName () === 'getMore ' ) {
77- $ cursorId = $ event ->getCommand ()->getMore ;
76+ $ cursorId = ( string ) $ event ->getCommand ()->getMore ;
7877
7978 if ( ! isset ($ this ->lsidByCursorId [$ cursorId ])) {
8079 throw new UnexpectedValueException ('No previous command observed for cursor ID: ' . $ cursorId );
@@ -84,7 +83,7 @@ class Test implements MongoDB\Driver\Monitoring\CommandSubscriber
8483 }
8584
8685 if ($ event ->getCommandName () === 'killCursors ' ) {
87- $ cursorId = $ event ->getCommand ()->cursors [0 ];
86+ $ cursorId = ( string ) $ event ->getCommand ()->cursors [0 ];
8887
8988 if ( ! isset ($ this ->lsidByCursorId [$ cursorId ])) {
9089 throw new UnexpectedValueException ('No previous command observed for cursor ID: ' . $ cursorId );
@@ -99,7 +98,7 @@ class Test implements MongoDB\Driver\Monitoring\CommandSubscriber
9998 /* Associate the aggregate's session ID with its cursor ID so it can be
10099 * looked up by the subsequent getMore or killCursors */
101100 if ($ event ->getCommandName () === 'aggregate ' ) {
102- $ cursorId = $ event ->getReply ()->cursor ->id ;
101+ $ cursorId = ( string ) $ event ->getReply ()->cursor ->id ;
103102 $ requestId = $ event ->getRequestId ();
104103
105104 $ this ->lsidByCursorId [$ cursorId ] = $ this ->lsidByRequestId [$ requestId ];
0 commit comments