コード例 #1
0
 /**
  * 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");
     }
 }
コード例 #2
0
ファイル: ConnectionsTest.php プロジェクト: thecsea/mysqltcs
 public function testOneConnection()
 {
     $db = (require __DIR__ . "/config.php");
     $connection = new Mysqltcs($db['host'], $db['user'], $db['psw'], $db['db']);
     $this->assertTrue($connection->isConnected());
 }