Skip to content

Commit b4ba7a7

Browse files
committed
Merge pull request #255
2 parents a3449c6 + aa5b258 commit b4ba7a7

File tree

6 files changed

+45
-0
lines changed

6 files changed

+45
-0
lines changed

src/Client.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ public function dropDatabase($databaseName, array $options = [])
120120
return $operation->execute($server);
121121
}
122122

123+
/**
124+
* Return the Manager.
125+
*
126+
* @return Manager
127+
*/
128+
public function getManager()
129+
{
130+
return $this->manager;
131+
}
132+
123133
/**
124134
* List databases.
125135
*

src/Collection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,16 @@ public function getDatabaseName()
576576
return $this->databaseName;
577577
}
578578

579+
/**
580+
* Return the Manager.
581+
*
582+
* @return Manager
583+
*/
584+
public function getManager()
585+
{
586+
return $this->manager;
587+
}
588+
579589
/**
580590
* Return the collection namespace.
581591
*

src/Database.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ public function getDatabaseName()
228228
return $this->databaseName;
229229
}
230230

231+
/**
232+
* Return the Manager.
233+
*
234+
* @return Manager
235+
*/
236+
public function getManager()
237+
{
238+
return $this->manager;
239+
}
240+
231241
/**
232242
* Returns information for all collections in this database.
233243
*

tests/ClientFunctionalTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public function setUp()
2222
$this->client->dropDatabase($this->getDatabaseName());
2323
}
2424

25+
public function testGetManager()
26+
{
27+
$this->assertInstanceOf('MongoDB\Driver\Manager', $this->client->getManager());
28+
}
29+
2530
public function testDropDatabase()
2631
{
2732
$bulkWrite = new BulkWrite();

tests/Collection/CollectionFunctionalTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public function provideInvalidConstructorOptions()
7373
return $options;
7474
}
7575

76+
public function testGetManager()
77+
{
78+
$this->assertSame($this->manager, $this->collection->getManager());
79+
}
80+
7681
public function testToString()
7782
{
7883
$this->assertEquals($this->getNamespace(), (string) $this->collection);

tests/Database/DatabaseFunctionalTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ public function provideInvalidConstructorOptions()
6363
return $options;
6464
}
6565

66+
public function testGetManager()
67+
{
68+
$this->assertSame($this->manager, $this->database->getManager());
69+
}
70+
6671
public function testToString()
6772
{
6873
$this->assertEquals($this->getDatabaseName(), (string) $this->database);

0 commit comments

Comments
 (0)