Skip to content

Commit 638de88

Browse files
committed
Add functional test on gridfs option passed to the constructor
1 parent e954006 commit 638de88

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/GridFS/BucketFunctionalTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,20 @@ public function testDisableMD5(): void
674674
{
675675
$options = ['disableMD5' => true];
676676
$id = $this->bucket->uploadFromStream('filename', $this->createStream('data'), $options);
677-
$this->assertCollectionCount($this->filesCollection, 1);
677+
678+
$fileDocument = $this->filesCollection->findOne(
679+
['_id' => $id]
680+
);
681+
682+
$this->assertArrayNotHasKey('md5', $fileDocument);
683+
}
684+
685+
public function testDisableMD5OptionInConstructor(): void
686+
{
687+
$options = ['disableMD5' => true];
688+
689+
$this->bucket = new Bucket($this->manager, $this->getDatabaseName(), $options);
690+
$id = $this->bucket->uploadFromStream('filename', $this->createStream('data'));
678691

679692
$fileDocument = $this->filesCollection->findOne(
680693
['_id' => $id]

0 commit comments

Comments
 (0)