init() public method

public init ( )
コード例 #1
0
ファイル: PoolTest.php プロジェクト: sagara-/mysql
 function testConnect()
 {
     $complete = false;
     (new NativeReactor())->run(function ($reactor) use(&$complete) {
         $db = new Pool("host=" . DB_HOST . ";user="******";pass="******";db=connectiontest", null, $reactor);
         (yield $db->init());
         // force waiting for connection
         /* use an alternative charset... Default is utf8mb4_general_ci */
         $db->setCharset("latin1_general_ci");
         $complete = true;
     });
     $this->assertEquals(true, $complete, "Database commands did not complete.");
 }