Skip to content

Commit c0757aa

Browse files
committed
Fix Collection construction in SpecificationTests
1 parent 46864db commit c0757aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/GridFS/SpecificationTests.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function runCommands($cmds, $result)
161161
$cmd['documents'][$docIndex] = $doc;
162162
}
163163
}
164-
$collection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), $collectionName));
164+
$collection = new Collection($this->manager, $this->getDatabaseName(), $collectionName);
165165
$this->commands[$key]($collection, $this->fixTypes($cmd, true));
166166
$this->collections[$collectionName] = $collection;
167167
}
@@ -175,20 +175,20 @@ public function initializeDatabases($data, $test)
175175
$collectionsToDrop = ['fs.files','fs.chunks','expected.files','expected.chunks'];
176176
$data = $this->fixTypes($data, true);
177177
foreach ($collectionsToDrop as $collectionName) {
178-
$collection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), $collectionName));
178+
$collection = new Collection($this->manager, $this->getDatabaseName(), $collectionName);
179179
$collection->drop();
180180
}
181181
if (isset($data['files']) && count($data['files']) > 0) {
182-
$filesCollection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), "fs.files"));
182+
$filesCollection = new Collection($this->manager, $this->getDatabaseName(), "fs.files");
183183
$filesCollection->insertMany($data['files']);
184-
$expectedFilesCollection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), "expected.files"));
184+
$expectedFilesCollection = new Collection($this->manager, $this->getDatabaseName(), "expected.files");
185185
$expectedFilesCollection->insertMany($data['files']);
186186
$this->collections['expected.files'] = $expectedFilesCollection;
187187
}
188188
if (isset($data['chunks']) && count($data['chunks']) > 0) {
189-
$chunksCollection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), "fs.chunks"));
189+
$chunksCollection = new Collection($this->manager, $this->getDatabaseName(), "fs.chunks");
190190
$chunksCollection->insertMany($data['chunks']);
191-
$expectedChunksCollection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), "expected.chunks"));
191+
$expectedChunksCollection = new Collection($this->manager, $this->getDatabaseName(), "expected.chunks");
192192
$expectedChunksCollection->insertMany($data['chunks']);
193193
$this->collections['expected.chunks'] = $expectedChunksCollection;
194194

@@ -197,7 +197,7 @@ public function initializeDatabases($data, $test)
197197
foreach($test['arrange']['data'] as $cmd) {
198198
foreach($cmd as $key => $value) {
199199
if(isset($this->commands[$key])) {
200-
$collection = new Collection($this->manager, sprintf("%s.%s", $this->getDatabaseName(), $cmd[$key]));
200+
$collection = new Collection($this->manager, $this->getDatabaseName(), $cmd[$key]);
201201
$this->commands[$key]($collection,$this->fixTypes($cmd, true));
202202
}
203203
}

0 commit comments

Comments
 (0)