示例#1
0
 /**
  * @return null
  */
 public function setUp()
 {
     $this->conn = new Connection($this->getConnectionDetail());
     $this->assertTrue($this->conn->connect());
     $this->driver = $this->conn->getDriver();
     $this->adapter = new Adapter($this->driver);
 }
示例#2
0
 /**
  * @return null
  */
 public function setUp()
 {
     $this->conn = new Connection($this->getConnectionDetail());
     $this->assertTrue($this->conn->connect());
     $this->driver = $this->conn->getDriver();
     $adapter = new Adapter($this->driver);
     $this->responseCallback = array($adapter, 'createResponse');
     $this->query = new Stmt();
 }
示例#3
0
 /**
  * The query class always frees the result so you don't have to worry
  * about use and store result flags from the prespective of having to
  * free results
  *
  * @return	null
  */
 public function testUnBufferedSendQuery()
 {
     $driver = $this->conn->getDriver();
     $sql = 'SELECT query_id, result FROM test_queries WHERE query_id=1';
     $result = $this->query->execute($driver, $sql, MYSQLI_USE_RESULT);
     $expected = array(array('query_id' => 1, 'result' => 'query issued'));
     $this->assertEquals($expected, $result);
     $sql = 'SELECT query_id, result FROM test_queries WHERE query_id=2';
     $result = $this->query->execute($driver, $sql);
     $expected = array(array('query_id' => 2, 'result' => 'query 2 issued'));
     $this->assertEquals($expected, $result);
 }