getMongo() public method

Get the MongoClient instance being wrapped.
Deprecation: 1.1 Replaced by getMongoClient(); will be removed for 2.0
public getMongo ( ) : MongoClient
return MongoClient
Ejemplo n.º 1
0
 public function testInitialize()
 {
     $conn = new Connection();
     $this->assertNull($conn->getMongo());
     $conn->initialize();
     $this->assertInstanceOf('Mongo', $conn->getMongo());
 }
Ejemplo n.º 2
0
 public function testSetMongoClient()
 {
     if (version_compare(phpversion('mongo'), '1.3.0', '<')) {
         $this->markTestSkipped('This test is not applicable to driver versions < 1.3.0');
     }
     $mongoClient = $this->getMockBuilder('MongoClient')->disableOriginalConstructor()->getMock();
     $conn = new Connection();
     $conn->setMongo($mongoClient);
     $this->assertSame($mongoClient, $conn->getMongo());
 }