Skip to content

Commit fb92403

Browse files
committed
PHPC-1345: Revise fragile session ID assertion
1 parent bde56bc commit fb92403

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/session/session-getLogicalSessionId-001.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ require_once __DIR__ . "/../utils/basic.inc";
1212
$manager = new MongoDB\Driver\Manager(URI);
1313
$session = $manager->startSession();
1414

15-
var_dump($session->getLogicalSessionId());
15+
$lsid = $session->getLogicalSessionId();
16+
17+
/* Note: we avoid dumping the Binary object as it may contain bytes that
18+
* intefere with the test suite's ability to compare expected output. */
19+
var_dump($lsid instanceof stdClass);
20+
var_dump($lsid->id instanceof MongoDB\BSON\Binary);
21+
var_dump($lsid->id->getType() === MongoDB\BSON\Binary::TYPE_UUID);
1622

1723
?>
1824
===DONE===
1925
<?php exit(0); ?>
2026
--EXPECTF--
21-
object(stdClass)#%d (%d) {
22-
["id"]=>
23-
object(MongoDB\BSON\Binary)#%d (%d) {
24-
["data"]=>
25-
string(16) "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c"
26-
["type"]=>
27-
int(4)
28-
}
29-
}
27+
bool(true)
28+
bool(true)
29+
bool(true)
3030
===DONE===

0 commit comments

Comments
 (0)