/** * throw exception if mysqltcs passed is not valid * @param Mysqltcs $mysqltcs * @throws MysqltcsException */ private static function mysqltcsCheck(Mysqltcs $mysqltcs) { if ($mysqltcs == null || !$mysqltcs instanceof Mysqltcs) { throw new MysqltcsException("mysqltcs passed is not an instance of Mysqltcs"); } if (!$mysqltcs->isConnected()) { throw new MysqltcsException("mysqltcs passed is not connected"); } }
public function testOneConnection() { $db = (require __DIR__ . "/config.php"); $connection = new Mysqltcs($db['host'], $db['user'], $db['psw'], $db['db']); $this->assertTrue($connection->isConnected()); }