Don't call the Mongo->close() method. The driver documentation states this should not
be necessary since it auto disconnects when out of scope.
With version 1.2.7, when using replica sets, close() can cause a segmentation fault.
public disconnect ( ) : boolean | ||
return | boolean | True |
public function testBadConnection() { $db = new MongoDb(array('host' => null, 'autoConnect' => false)); $this->expectException('Could not connect to the database.'); $this->assertFalse($db->connect()); $this->assertTrue($db->disconnect()); }
public function testBadConnection() { $db = new MongoDb(array('host' => null, 'autoConnect' => false)); $this->assertFalse($db->connect()); $this->assertTrue($db->disconnect()); }