File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ PHPC-924: Using a projection with an empty field name causes a crash when destroying cursor
3
+ --SKIPIF--
4
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; CLEANUP (STANDALONE ) ?>
5
+ --FILE--
6
+ <?php
7
+ require_once __DIR__ . "/../utils/basic.inc " ;
8
+
9
+ $ manager = new MongoDB \Driver \Manager (STANDALONE );
10
+
11
+ $ query = new MongoDB \Driver \Query ([], ['projection ' => ['' => 1 ]]);
12
+
13
+ echo throws (function () use ($ manager , $ query ) {
14
+ $ cursor = $ manager ->executeQuery (NS , $ query );
15
+ var_dump ($ cursor ->toArray ());
16
+ }, 'MongoDB\Driver\Exception\RuntimeException ' ), "\n" ;
17
+
18
+ ?>
19
+ ===DONE===
20
+ <?php exit (0 ); ?>
21
+ --EXPECT--
22
+ OK: Got MongoDB\Driver\Exception\RuntimeException
23
+ Cannot use empty keys in 'opts'.
24
+ ===DONE===
You can’t perform that action at this time.
0 commit comments