Commit b4ba7a70 authored by Jeremy Mikola's avatar Jeremy Mikola

Merge pull request #255

parents a3449c6a aa5b258e
......@@ -120,6 +120,16 @@ class Client
return $operation->execute($server);
}
/**
* Return the Manager.
*
* @return Manager
*/
public function getManager()
{
return $this->manager;
}
/**
* List databases.
*
......
......@@ -576,6 +576,16 @@ class Collection
return $this->databaseName;
}
/**
* Return the Manager.
*
* @return Manager
*/
public function getManager()
{
return $this->manager;
}
/**
* Return the collection namespace.
*
......
......@@ -228,6 +228,16 @@ class Database
return $this->databaseName;
}
/**
* Return the Manager.
*
* @return Manager
*/
public function getManager()
{
return $this->manager;
}
/**
* Returns information for all collections in this database.
*
......
......@@ -22,6 +22,11 @@ class ClientFunctionalTest extends FunctionalTestCase
$this->client->dropDatabase($this->getDatabaseName());
}
public function testGetManager()
{
$this->assertInstanceOf('MongoDB\Driver\Manager', $this->client->getManager());
}
public function testDropDatabase()
{
$bulkWrite = new BulkWrite();
......
......@@ -73,6 +73,11 @@ class CollectionFunctionalTest extends FunctionalTestCase
return $options;
}
public function testGetManager()
{
$this->assertSame($this->manager, $this->collection->getManager());
}
public function testToString()
{
$this->assertEquals($this->getNamespace(), (string) $this->collection);
......
......@@ -63,6 +63,11 @@ class DatabaseFunctionalTest extends FunctionalTestCase
return $options;
}
public function testGetManager()
{
$this->assertSame($this->manager, $this->database->getManager());
}
public function testToString()
{
$this->assertEquals($this->getDatabaseName(), (string) $this->database);
......
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