|
@ -62,23 +62,17 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertTrue($this->stmt->bindParam('place', $val)); |
|
|
$this->assertTrue($this->stmt->bindParam('place', $val)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @expectedException GeneralException |
|
|
|
|
|
* @expectedExceptionMessage Placeholder must be an integer or string |
|
|
|
|
|
*/ |
|
|
|
|
|
public function testBindParamExceptionParam() |
|
|
public function testBindParamExceptionParam() |
|
|
{ |
|
|
{ |
|
|
$val = 1; |
|
|
$val = 1; |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Placeholder must be an integer or string'); |
|
|
$this->stmt->bindParam(array(), $val); |
|
|
$this->stmt->bindParam(array(), $val); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @expectedException GeneralException |
|
|
|
|
|
* @expectedExceptionMessage Objects excepts DbExpr not allowed. |
|
|
|
|
|
*/ |
|
|
|
|
|
public function testBindParamExceptionWrongObject() |
|
|
public function testBindParamExceptionWrongObject() |
|
|
{ |
|
|
{ |
|
|
$val = $this->getMock('NotDbExpr'); |
|
|
$val = $this->getMock('NotDbExpr'); |
|
|
|
|
|
$this->setExpectedException('GeneralException', 'Objects excepts DbExpr not allowed.'); |
|
|
$this->stmt->bindParam('paa', $val); |
|
|
$this->stmt->bindParam('paa', $val); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -98,7 +92,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
->will($this->returnCallback(array($this, 'driverQuote'))); |
|
|
->will($this->returnCallback(array($this, 'driverQuote'))); |
|
|
|
|
|
|
|
|
$this->setDriverGetConnectionMethod(); |
|
|
$this->setDriverGetConnectionMethod(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$result = $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
$result = $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
$this->assertTrue($result); |
|
|
$this->assertTrue($result); |
|
|
} |
|
|
} |
|
@ -112,7 +106,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
define('DEBUG', false); |
|
|
define('DEBUG', false); |
|
|
} |
|
|
} |
|
|
$this->setDriverGetConnectionMethod(); |
|
|
$this->setDriverGetConnectionMethod(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->sql = 'PLAIN SQL'; |
|
|
$this->sql = 'PLAIN SQL'; |
|
|
$result = $this->stmt->execute(array()); |
|
|
$result = $this->stmt->execute(array()); |
|
|
$this->assertTrue($result); |
|
|
$this->assertTrue($result); |
|
@ -214,7 +208,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
->expects($this->any()) |
|
|
->expects($this->any()) |
|
|
->method('getConnection') |
|
|
->method('getConnection') |
|
|
->will($this->returnValue($mysqliMock)); |
|
|
->will($this->returnValue($mysqliMock)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
$this->assertSame(array('pair' => 'value'), $this->stmt->fetchPairs()); |
|
|
$this->assertSame(array('pair' => 'value'), $this->stmt->fetchPairs()); |
|
|
} |
|
|
} |
|
@ -302,7 +296,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); |
|
|
|
|
|
|
|
|
$this->setExpectedException('GeneralException'); |
|
|
$this->setExpectedException('GeneralException'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->stmt->fetch(324); |
|
|
$this->stmt->fetch(324); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -336,7 +330,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase |
|
|
->method('query') |
|
|
->method('query') |
|
|
->with($this->anything()) |
|
|
->with($this->anything()) |
|
|
->will($this->returnValue($resultMock)); |
|
|
->will($this->returnValue($resultMock)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->driver |
|
|
$this->driver |
|
|
->expects($this->any()) |
|
|
->expects($this->any()) |
|
|
->method('getConnection') |
|
|
->method('getConnection') |
|
|