public function testInitialize() { $conn = new Connection(); $this->assertNull($conn->getMongo()); $conn->initialize(); $this->assertInstanceOf('Mongo', $conn->getMongo()); }
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()); }