Skip to content

Commit a5ad841

Browse files
doublecompilejmikola
authored andcommitted
Add missing namespace imports in GridFS\Bucket (fixes #151)
1 parent ca9118e commit a5ad841

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/GridFS/Bucket.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use MongoDB\BSON\ObjectId;
66
use MongoDB\Driver\Cursor;
77
use MongoDB\Driver\Manager;
8+
use MongoDB\Driver\ReadPreference;
9+
use MongoDB\Driver\WriteConcern;
810
use MongoDB\Exception\GridFSFileNotFoundException;
911
use MongoDB\Exception\InvalidArgumentException;
1012
use MongoDB\Operation\Find;

tests/GridFS/BucketFunctionalTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22

33
namespace MongoDB\Tests\GridFS;
44

5+
use MongoDB\Driver\ReadPreference;
6+
use MongoDB\Driver\WriteConcern;
57
use MongoDB\GridFS\Bucket;
68

79
/**
810
* Functional tests for the Bucket class.
911
*/
1012
class BucketFunctionalTest extends FunctionalTestCase
1113
{
14+
public function testValidConstructorOptions()
15+
{
16+
new Bucket($this->manager, $this->getDatabaseName(), [
17+
'bucketName' => 'test',
18+
'chunkSizeBytes' => 8192,
19+
'readPreference' => new ReadPreference(ReadPreference::RP_PRIMARY),
20+
'writeConcern' => new WriteConcern(WriteConcern::MAJORITY, 1000),
21+
]);
22+
}
1223

1324
/**
1425
* @expectedException MongoDB\Exception\InvalidArgumentException

0 commit comments

Comments
 (0)