Commit 72c412d2 authored by j-licht's avatar j-licht Committed by Jeremy Mikola

Use correct Collection constructor args in GridFS classes

Fixes #135
parent 4fbd208d
...@@ -31,8 +31,8 @@ class GridFSCollectionsWrapper ...@@ -31,8 +31,8 @@ class GridFSCollectionsWrapper
*/ */
public function __construct(Manager $manager, $databaseName, $bucketName, array $collectionOptions = []) public function __construct(Manager $manager, $databaseName, $bucketName, array $collectionOptions = [])
{ {
$this->filesCollection = new Collection($manager, sprintf('%s.%s.files', $databaseName, $bucketName), $collectionOptions); $this->filesCollection = new Collection($manager, $databaseName, sprintf('%s.files', $bucketName), $collectionOptions);
$this->chunksCollection = new Collection($manager, sprintf('%s.%s.chunks', $databaseName, $bucketName), $collectionOptions); $this->chunksCollection = new Collection($manager, $databaseName, sprintf('%s.chunks', $bucketName), $collectionOptions);
} }
public function dropCollections(){ public function dropCollections(){
......
...@@ -18,7 +18,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase ...@@ -18,7 +18,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
{ {
parent::setUp(); parent::setUp();
foreach(['fs.files', 'fs.chunks'] as $collection){ foreach(['fs.files', 'fs.chunks'] as $collection){
$col = new Collection($this->manager, sprintf("%s.%s",$this->getDatabaseName(), $collection)); $col = new Collection($this->manager, $this->getDatabaseName(), $collection);
$col->drop(); $col->drop();
} }
$this->bucket = new \MongoDB\GridFS\Bucket($this->manager, $this->getDatabaseName()); $this->bucket = new \MongoDB\GridFS\Bucket($this->manager, $this->getDatabaseName());
...@@ -28,7 +28,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase ...@@ -28,7 +28,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
public function tearDown() public function tearDown()
{ {
foreach(['fs.files', 'fs.chunks'] as $collection){ foreach(['fs.files', 'fs.chunks'] as $collection){
$col = new Collection($this->manager, sprintf("%s.%s",$this->getDatabaseName(), $collection)); $col = new Collection($this->manager, $this->getDatabaseName(), $collection);
$col->drop(); $col->drop();
} }
if ($this->hasFailed()) { if ($this->hasFailed()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment