diff --git a/tests/Model/CodecCursorFunctionalTest.php b/tests/Model/CodecCursorFunctionalTest.php index 432d71732..48fd2cb59 100644 --- a/tests/Model/CodecCursorFunctionalTest.php +++ b/tests/Model/CodecCursorFunctionalTest.php @@ -55,12 +55,15 @@ function (...$args) use (&$previousErrorHandler, &$deprecations) { E_USER_DEPRECATED | E_DEPRECATED, ); - $cursorId = $codecCursor->getId(); + $cursorId = $codecCursor->getId(true); } finally { restore_error_handler(); } - self::assertInstanceOf(CursorId::class, $cursorId); + self::logicalOr( + self::isInstanceOf(Int64::class), + self::isInstanceOf(CursorId::class), + )->matches($cursorId); // Expect 2 deprecations: 1 from CodecCursor, one from Cursor self::assertCount(2, $deprecations); diff --git a/tests/Operation/WatchFunctionalTest.php b/tests/Operation/WatchFunctionalTest.php index 58b8c844c..deb9d976d 100644 --- a/tests/Operation/WatchFunctionalTest.php +++ b/tests/Operation/WatchFunctionalTest.php @@ -720,7 +720,7 @@ public function testInitialCursorIsNotClosed(): void * reports the cursor as alive. While the cursor ID is accessed through * ChangeStream, we'll need to use reflection to access the internal * Cursor and call isDead(). */ - $this->assertNotEquals('0', (string) $changeStream->getCursorId()); + $this->assertNotEquals('0', (string) $changeStream->getCursorId(true)); $rc = new ReflectionClass(ChangeStream::class); $rp = $rc->getProperty('iterator'); @@ -1370,11 +1370,11 @@ public function testOriginalReadPreferenceIsPreservedOnResume(): void } $changeStream = $operation->execute($secondary); - $previousCursorId = $changeStream->getCursorId(); + $previousCursorId = $changeStream->getCursorId(true); $this->forceChangeStreamResume(); $changeStream->next(); - $this->assertNotSame($previousCursorId, $changeStream->getCursorId()); + $this->assertNotSame($previousCursorId, $changeStream->getCursorId(true)); $getCursor = Closure::bind( fn () => $this->iterator->getInnerIterator(),