Repo2\QueryReactor\Tests\TestUtil::getControllerParams PHP Method

getControllerParams() public static method

public static getControllerParams ( )
    public static function getControllerParams()
    {
        return ['host' => self::getenv('REPO2_DB_HOST', 'localhost'), 'dbname' => self::getenv('REPO2_DB_NAME', 'repo2_test'), 'username' => self::getenv('REPO2_DB_USERNAME', 'root'), 'passwd' => self::getenv('REPO2_DB_PASSWD', '')];
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @expectedException \Repo2\QueryReactor\Driver\Mysqli\MysqliException
  * @expectedExceptionMessage MySQL server has gone away
  */
 public function testFailedQuery()
 {
     $params = TestUtil::getControllerParams();
     $driver = $this->getDriver();
     $link = $driver->connect($params, $params['username'], $params['passwd']);
     /* @var $link \mysqli */
     $processid = $link->thread_id;
     $link->kill($processid);
     $expr = $this->getMock('\\Repo2\\QueryBuilder\\ExpressionInterface');
     $expr->expects($this->once())->method('compile')->will($this->returnValue('SELECT 1'));
     $driver->query($link, $expr);
 }
All Usage Examples Of Repo2\QueryReactor\Tests\TestUtil::getControllerParams