Skip to content

Commit 3897150

Browse files
committed
Merge pull request #242
2 parents 5f71c1b + cff6b0a commit 3897150

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

tests/Collection/CollectionFunctionalTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function testFindOne()
127127
$this->assertSameDocument($expected, $this->collection->findOne($filter, $options));
128128
}
129129

130-
public function testWithOptionsInheritsReadPreferenceAndWriteConcern()
130+
public function testWithOptionsInheritsOptions()
131131
{
132132
$collectionOptions = [
133133
'readConcern' => new ReadConcern(ReadConcern::LOCAL),
@@ -140,6 +140,9 @@ public function testWithOptionsInheritsReadPreferenceAndWriteConcern()
140140
$clone = $collection->withOptions();
141141
$debug = $clone->__debugInfo();
142142

143+
$this->assertSame($this->manager, $debug['manager']);
144+
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
145+
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
143146
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
144147
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
145148
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);
@@ -150,7 +153,7 @@ public function testWithOptionsInheritsReadPreferenceAndWriteConcern()
150153
$this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW());
151154
}
152155

153-
public function testWithOptionsPassesReadPreferenceAndWriteConcern()
156+
public function testWithOptionsPassesOptions()
154157
{
155158
$collectionOptions = [
156159
'readConcern' => new ReadConcern(ReadConcern::LOCAL),

tests/Database/DatabaseFunctionalTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ public function testGetSelectsCollectionAndInheritsOptions()
139139
$collection = $database->{$this->getCollectionName()};
140140
$debug = $collection->__debugInfo();
141141

142-
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
142+
$this->assertSame($this->manager, $debug['manager']);
143143
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
144+
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
144145
$this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']);
145146
$this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW());
146147
}
@@ -158,6 +159,9 @@ public function testSelectCollectionInheritsOptions()
158159
$collection = $database->selectCollection($this->getCollectionName());
159160
$debug = $collection->__debugInfo();
160161

162+
$this->assertSame($this->manager, $debug['manager']);
163+
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
164+
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
161165
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
162166
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
163167
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);
@@ -252,6 +256,8 @@ public function testWithOptionsInheritsOptions()
252256
$clone = $database->withOptions();
253257
$debug = $clone->__debugInfo();
254258

259+
$this->assertSame($this->manager, $debug['manager']);
260+
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
255261
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
256262
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
257263
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);

0 commit comments

Comments
 (0)