@@ -18,45 +18,66 @@ $tests = [
1818 pack ('VCa*xVCa*xxCa*xVCa*xxx ' , 31 , 0x03 , 'e1 ' , 9 , 0x06 , 'u1 ' , 0x03 , 'e2 ' , 9 , 0x06 , 'u2 ' ),
1919];
2020
21+ ini_set ("mongodb.debug " , "stdout " );
2122foreach ($ tests as $ bson ) {
22- try {
23- var_dump (toPHP ($ bson ));
24- } catch (MongoDB \Driver \Exception \UnexpectedValueException $ e ) {
25- do {
26- printf ("OK: %s \n%s \n" , get_class ($ e ), $ e ->getMessage ());
27- } while ($ e = $ e ->getPrevious ());
28- }
29-
30- echo "\n" ;
23+ var_dump (toPHP ($ bson ));
3124}
25+ ini_set ("mongodb.debug " , "off " );
3226
3327?>
3428===DONE===
3529<?php exit (0 ); ?>
36- --EXPECT--
37- OK: MongoDB\Driver\Exception\UnexpectedValueException
38- Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
39- OK: MongoDB\Driver\Exception\UnexpectedValueException
40- Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
41-
42- OK: MongoDB\Driver\Exception\UnexpectedValueException
43- Detected unsupported BSON type 0x0E (symbol) for fieldname "s1"
44- OK: MongoDB\Driver\Exception\UnexpectedValueException
45- Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
46-
47- OK: MongoDB\Driver\Exception\UnexpectedValueException
48- Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
49- OK: MongoDB\Driver\Exception\UnexpectedValueException
50- Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
51-
52- OK: MongoDB\Driver\Exception\UnexpectedValueException
53- Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
54- OK: MongoDB\Driver\Exception\UnexpectedValueException
55- Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
56-
57- OK: MongoDB\Driver\Exception\UnexpectedValueException
58- Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
59- OK: MongoDB\Driver\Exception\UnexpectedValueException
60- Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
61-
30+ --EXPECTF--
31+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
32+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
33+ object(stdClass)#%d (%d) {
34+ ["u1"]=>
35+ NULL
36+ ["u2"]=>
37+ NULL
38+ }
39+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
40+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x0E (symbol) for fieldname "s1"
41+ object(stdClass)#%d (%d) {
42+ ["u1"]=>
43+ NULL
44+ ["s1"]=>
45+ NULL
46+ }
47+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
48+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
49+ object(stdClass)#%d (%d) {
50+ ["u1"]=>
51+ NULL
52+ ["e1"]=>
53+ object(stdClass)#%d (%d) {
54+ ["u2"]=>
55+ NULL
56+ }
57+ }
58+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
59+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
60+ object(stdClass)#%d (%d) {
61+ ["e1"]=>
62+ object(stdClass)#%d (%d) {
63+ ["u1"]=>
64+ NULL
65+ }
66+ ["u2"]=>
67+ NULL
68+ }
69+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u1"
70+ [%s] PHONGO-BSON: WARNING > Detected unsupported BSON type 0x06 (undefined) for fieldname "u2"
71+ object(stdClass)#3 (%d) {
72+ ["e1"]=>
73+ object(stdClass)#%d (%d) {
74+ ["u1"]=>
75+ NULL
76+ }
77+ ["e2"]=>
78+ object(stdClass)#%d (%d) {
79+ ["u2"]=>
80+ NULL
81+ }
82+ }
6283===DONE===
0 commit comments