@@ -194,7 +194,7 @@ public function testDownloadToStreamShouldRequireDestinationStream($destination)
194194
195195 public function provideInvalidStreamValues ()
196196 {
197- return $ this ->wrapValuesForDataProvider ([ null , 123 , ' foo ' , [], hash_init ( ' md5 ' )] );
197+ return $ this ->wrapValuesForDataProvider ($ this -> getInvalidStreamValues () );
198198 }
199199
200200 /**
@@ -407,13 +407,18 @@ public function testGetFileDocumentForStreamWithWritableStream()
407407
408408 /**
409409 * @expectedException MongoDB\Exception\InvalidArgumentException
410- * @dataProvider provideInvalidStreamValues
410+ * @dataProvider provideInvalidGridFSStreamValues
411411 */
412- public function testGetFileDocumentForStreamShouldRequireStreamResource ($ stream )
412+ public function testGetFileDocumentForStreamShouldRequireGridFSStreamResource ($ stream )
413413 {
414414 $ this ->bucket ->getFileDocumentForStream ($ stream );
415415 }
416416
417+ public function provideInvalidGridFSStreamValues ()
418+ {
419+ return $ this ->wrapValuesForDataProvider (array_merge ($ this ->getInvalidStreamValues (), [$ this ->createStream ()]));
420+ }
421+
417422 public function testGetFileIdForStreamUsesTypeMap ()
418423 {
419424 $ stream = $ this ->bucket ->openUploadStream ('filename ' , ['_id ' => ['x ' => 1 ]]);
@@ -441,9 +446,9 @@ public function testGetFileIdForStreamWithWritableStream()
441446
442447 /**
443448 * @expectedException MongoDB\Exception\InvalidArgumentException
444- * @dataProvider provideInvalidStreamValues
449+ * @dataProvider provideInvalidGridFSStreamValues
445450 */
446- public function testGetFileIdForStreamShouldRequireStreamResource ($ stream )
451+ public function testGetFileIdForStreamShouldRequireGridFSStreamResource ($ stream )
447452 {
448453 $ this ->bucket ->getFileIdForStream ($ stream );
449454 }
@@ -714,4 +719,14 @@ private function assertIndexExists($collectionName, $indexName, $callback = null
714719 call_user_func ($ callback , $ foundIndex );
715720 }
716721 }
722+
723+ /**
724+ * Return a list of invalid stream values.
725+ *
726+ * @return array
727+ */
728+ private function getInvalidStreamValues ()
729+ {
730+ return [null , 123 , 'foo ' , [], hash_init ('md5 ' )];
731+ }
717732}
0 commit comments