public function testGoodConnectionBadDatabase() { $db = new MongoDb(array('database' => null, 'autoConnnect' => false)); $this->assertException('Could not connect to the database.', function () use($db) { $db->connect(); }); }
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 testGoodConnectionGoodDatabase() { $db = new MongoDb(array('autoConnect' => false) + $this->_testConfig); $this->assertTrue($db->connect()); }