@@ -20,7 +20,7 @@ public function testBasic()
20
20
$ this ->assertEquals (1 , $ this ->collectionsWrapper ->getFilesCollection ()->count ());
21
21
$ this ->assertEquals (1 , $ this ->collectionsWrapper ->getChunksCollection ()->count ());
22
22
23
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ id ]);
23
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ id ], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
24
24
25
25
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
26
26
$ stream = fopen ('php://temp ' , 'w+ ' );
@@ -46,7 +46,7 @@ public function testBasic()
46
46
$ this ->assertEquals (2 , $ this ->collectionsWrapper ->getFilesCollection ()->count ());
47
47
$ this ->assertEquals (1 , $ this ->collectionsWrapper ->getChunksCollection ()->count ());
48
48
49
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ id ]);
49
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ id ], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
50
50
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
51
51
$ stream = fopen ('php://temp ' , 'w+ ' );
52
52
$ download ->downloadToStream ($ stream );
@@ -100,7 +100,7 @@ public function testDownloadDefaultOpts()
100
100
$ upload = new \MongoDB \GridFS \GridFSUpload ($ this ->collectionsWrapper , "test " );
101
101
$ upload ->close ();
102
102
103
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " => $ upload ->getId ()]);
103
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " => $ upload ->getId ()], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
104
104
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
105
105
$ download ->close ();
106
106
@@ -124,7 +124,7 @@ public function testDownloadCustomOpts()
124
124
$ upload ->insertChunks ("hello world " );
125
125
$ upload ->close ();
126
126
127
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " => $ upload ->getId ()]);
127
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " => $ upload ->getId ()], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
128
128
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
129
129
130
130
$ this ->assertEquals ("test " , $ download ->getFile ()->filename );
@@ -185,7 +185,7 @@ public function testMultipleReads()
185
185
$ upload = new \MongoDB \GridFS \GridFSUpload ($ this ->collectionsWrapper , "test " , ["chunkSizeBytes " =>3 ]);
186
186
$ upload ->insertChunks ("hello world " );
187
187
$ upload ->close ();
188
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ upload ->getId ()]);
188
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ upload ->getId ()], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
189
189
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
190
190
$ this ->assertEquals ("he " , $ download ->downloadNumBytes (2 ));
191
191
$ this ->assertEquals ("ll " , $ download ->downloadNumBytes (2 ));
@@ -205,7 +205,7 @@ public function testProvidedMultipleReads($data)
205
205
$ upload = new \MongoDB \GridFS \GridFSUpload ($ this ->collectionsWrapper , "test " , ["chunkSizeBytes " =>rand (1 , 5 )]);
206
206
$ upload ->insertChunks ($ data );
207
207
$ upload ->close ();
208
- $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ upload ->getId ()]);
208
+ $ file = $ this ->collectionsWrapper ->getFilesCollection ()->findOne (["_id " =>$ upload ->getId ()], [ ' typeMap ' => [ ' root ' => ' stdClass ' ]] );
209
209
$ download = new \MongoDB \GridFS \GridFSDownload ($ this ->collectionsWrapper , $ file );
210
210
211
211
$ readPos = 0 ;
@@ -222,7 +222,7 @@ public function testProvidedMultipleReads($data)
222
222
$ download ->close ();
223
223
}
224
224
/**
225
- * @expectedException \MongoDB\Exception\InvalidArgumentTypeException
225
+ * @expectedException \MongoDB\Exception\InvalidArgumentException
226
226
* @dataProvider provideInvalidUploadConstructorOptions
227
227
*/
228
228
public function testUploadConstructorOptionTypeChecks (array $ options )
0 commit comments