Skip to content

Commit a3cbc53

Browse files
committed
Restore cursorid serialisation test
1 parent 9aac2e8 commit a3cbc53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/cursorid/cursorid-002.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $bulk->insert(['_id' => 3]);
2121
$server->executeBulkWrite(NS, $bulk);
2222

2323
$cursor = $server->executeQuery(NS, new MongoDB\Driver\Query([], ['batchSize' => 2]));
24-
$cursorId = $cursor->getId(true);
24+
$cursorId = $cursor->getId();
2525

2626
$command = new MongoDB\Driver\Command([
2727
'killCursors' => COLLECTION_NAME,
@@ -32,12 +32,13 @@ $command = new MongoDB\Driver\Command([
3232
* unserializing the result document requires a 64-bit platform. */
3333
$result = $server->executeCommand(DATABASE_NAME, $command)->toArray()[0];
3434
printf("Killed %d cursor(s)\n", count($result->cursorsKilled));
35-
printf("Killed expected cursor: %s\n", $cursorId == $result->cursorsKilled[0] ? 'yes' : 'no');
35+
printf("Killed expected cursor: %s\n", (string) $cursorId === (string) $result->cursorsKilled[0] ? 'yes' : 'no');
3636

3737
?>
3838
===DONE===
3939
<?php exit(0); ?>
4040
--EXPECTF--
41+
Deprecated: MongoDB\Driver\Cursor::getId(): The method "MongoDB\Driver\Cursor::getId" will no longer return a "MongoDB\Driver\CursorId" instance in the future. Pass "true" as argument to change to the new behavior and receive a "MongoDB\BSON\Int64" instance instead. in %s
4142
Killed 1 cursor(s)
4243
Killed expected cursor: yes
4344
===DONE===

0 commit comments

Comments
 (0)