コード例 #1
0
ファイル: Database.php プロジェクト: dustingraham/react-mysql
 public function __construct($credentials = null, $loop = null)
 {
     if (!is_null($credentials)) {
         ConnectionFactory::init($credentials);
     }
     // Use the provided loop, otherwise create one.
     $this->loop = $loop ?: Factory::create();
     $this->initLoop();
     $this->pool = new ConnectionPool();
 }
コード例 #2
0
 /**
  * @expectedException \PHPUnit_Framework_Error_Warning
  */
 public function testBadCredentials()
 {
     ConnectionFactory::init(['localhost', 'bad.username', 'bad.password', 'fake']);
     ConnectionFactory::createConnection();
 }
コード例 #3
0
ファイル: TestCase.php プロジェクト: dustingraham/react-mysql
 public function setUp()
 {
     parent::setUp();
     $this->initDatabase();
     ConnectionFactory::init($this->getCredentials());
 }