Пример #1
0
 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();
 }
 /**
  * @expectedException \PHPUnit_Framework_Error_Warning
  */
 public function testBadCredentials()
 {
     ConnectionFactory::init(['localhost', 'bad.username', 'bad.password', 'fake']);
     ConnectionFactory::createConnection();
 }
Пример #3
0
 public function setUp()
 {
     parent::setUp();
     $this->initDatabase();
     ConnectionFactory::init($this->getCredentials());
 }