Commit 38971507 authored by Jeremy Mikola's avatar Jeremy Mikola

Merge pull request #242

parents 5f71c1be cff6b0aa
......@@ -127,7 +127,7 @@ class CollectionFunctionalTest extends FunctionalTestCase
$this->assertSameDocument($expected, $this->collection->findOne($filter, $options));
}
public function testWithOptionsInheritsReadPreferenceAndWriteConcern()
public function testWithOptionsInheritsOptions()
{
$collectionOptions = [
'readConcern' => new ReadConcern(ReadConcern::LOCAL),
......@@ -140,6 +140,9 @@ class CollectionFunctionalTest extends FunctionalTestCase
$clone = $collection->withOptions();
$debug = $clone->__debugInfo();
$this->assertSame($this->manager, $debug['manager']);
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);
......@@ -150,7 +153,7 @@ class CollectionFunctionalTest extends FunctionalTestCase
$this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW());
}
public function testWithOptionsPassesReadPreferenceAndWriteConcern()
public function testWithOptionsPassesOptions()
{
$collectionOptions = [
'readConcern' => new ReadConcern(ReadConcern::LOCAL),
......
......@@ -139,8 +139,9 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$collection = $database->{$this->getCollectionName()};
$debug = $collection->__debugInfo();
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
$this->assertSame($this->manager, $debug['manager']);
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
$this->assertInstanceOf('MongoDB\Driver\WriteConcern', $debug['writeConcern']);
$this->assertSame(WriteConcern::MAJORITY, $debug['writeConcern']->getW());
}
......@@ -158,6 +159,9 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$collection = $database->selectCollection($this->getCollectionName());
$debug = $collection->__debugInfo();
$this->assertSame($this->manager, $debug['manager']);
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
$this->assertSame($this->getCollectionName(), $debug['collectionName']);
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);
......@@ -252,6 +256,8 @@ class DatabaseFunctionalTest extends FunctionalTestCase
$clone = $database->withOptions();
$debug = $clone->__debugInfo();
$this->assertSame($this->manager, $debug['manager']);
$this->assertSame($this->getDatabaseName(), $debug['databaseName']);
$this->assertInstanceOf('MongoDB\Driver\ReadConcern', $debug['readConcern']);
$this->assertSame(ReadConcern::LOCAL, $debug['readConcern']->getLevel());
$this->assertInstanceOf('MongoDB\Driver\ReadPreference', $debug['readPreference']);
......
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