Skip to content

Commit 72c412d

Browse files
j-lichtjmikola
authored andcommitted
Use correct Collection constructor args in GridFS classes
Fixes #135
1 parent 4fbd208 commit 72c412d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/GridFS/GridFSCollectionsWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class GridFSCollectionsWrapper
3131
*/
3232
public function __construct(Manager $manager, $databaseName, $bucketName, array $collectionOptions = [])
3333
{
34-
$this->filesCollection = new Collection($manager, sprintf('%s.%s.files', $databaseName, $bucketName), $collectionOptions);
35-
$this->chunksCollection = new Collection($manager, sprintf('%s.%s.chunks', $databaseName, $bucketName), $collectionOptions);
34+
$this->filesCollection = new Collection($manager, $databaseName, sprintf('%s.files', $bucketName), $collectionOptions);
35+
$this->chunksCollection = new Collection($manager, $databaseName, sprintf('%s.chunks', $bucketName), $collectionOptions);
3636
}
3737

3838
public function dropCollections(){

tests/GridFS/FunctionalTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function setUp()
1818
{
1919
parent::setUp();
2020
foreach(['fs.files', 'fs.chunks'] as $collection){
21-
$col = new Collection($this->manager, sprintf("%s.%s",$this->getDatabaseName(), $collection));
21+
$col = new Collection($this->manager, $this->getDatabaseName(), $collection);
2222
$col->drop();
2323
}
2424
$this->bucket = new \MongoDB\GridFS\Bucket($this->manager, $this->getDatabaseName());
@@ -28,7 +28,7 @@ public function setUp()
2828
public function tearDown()
2929
{
3030
foreach(['fs.files', 'fs.chunks'] as $collection){
31-
$col = new Collection($this->manager, sprintf("%s.%s",$this->getDatabaseName(), $collection));
31+
$col = new Collection($this->manager, $this->getDatabaseName(), $collection);
3232
$col->drop();
3333
}
3434
if ($this->hasFailed()) {

0 commit comments

Comments
 (0)