Skip to content

Commit acc9413

Browse files
committed
Revise vector tests
1 parent dbb9bc1 commit acc9413

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
MongoDB\BSON\Binary unserialization requires valid vector data (__serialize and __unserialize)
3+
--FILE--
4+
<?php
5+
6+
require_once __DIR__ . '/../utils/basic.inc';
7+
8+
echo throws(function() {
9+
unserialize('O:19:"MongoDB\BSON\Binary":2:{s:4:"data";s:0:"";s:4:"type";i:9;}');
10+
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
11+
12+
?>
13+
===DONE===
14+
<?php exit(0); ?>
15+
--EXPECT--
16+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
17+
Binary vector data is invalid
18+
===DONE===

tests/bson/bson-vectortype-001.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
--TEST--
2-
MongoDB\BSON\VectorType
2+
MongoDB\BSON\VectorType cases
33
--FILE--
44
<?php
55

6-
var_dump(MongoDB\BSON\VectorType::Float32);
7-
var_dump(MongoDB\BSON\VectorType::Int8);
8-
var_dump(MongoDB\BSON\VectorType::PackedBit);
6+
foreach (VectorType::cases() as $case) {
7+
var_dump($case);
8+
}
99

1010
?>
1111
===DONE===

0 commit comments

Comments
 (0)