public function disconnect() { if ($this->server && $this->server->getConnections()) { $this->_isConnected = false; unset($this->connection, $this->server); } return 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()); }