Browse Source

Modified MySQLiStatementTest with use PROFILER_DETAILS set.

master
Alexander Demidov 13 years ago
parent
commit
2395adf7b8
  1. 25
      tests/model/MySQLiStatementTest.php

25
tests/model/MySQLiStatementTest.php

@ -83,7 +83,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testExecute() public function testExecute()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->driver $this->driver
->expects($this->any()) ->expects($this->any())
@ -102,7 +102,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testExecuteNoPlaceholders() public function testExecuteNoPlaceholders()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->sql = 'PLAIN SQL'; $this->sql = 'PLAIN SQL';
@ -116,7 +116,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetchNoResult() public function testFetchNoResult()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->assertFalse($this->stmt->fetch()); $this->assertFalse($this->stmt->fetch());
} }
@ -126,7 +126,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testDriverExecuteNoResult() public function testDriverExecuteNoResult()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionWrongResultMethod(); $this->setDriverGetConnectionWrongResultMethod();
$this->setExpectedException('GeneralException', 'ERROR'); $this->setExpectedException('GeneralException', 'ERROR');
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
@ -138,7 +138,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetch() public function testFetch()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->assertSame('OBJECT', $this->stmt->fetch()); $this->assertSame('OBJECT', $this->stmt->fetch());
@ -153,7 +153,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetchObject() public function testFetchObject()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->assertSame('OBJECT', $this->stmt->fetchObject()); $this->assertSame('OBJECT', $this->stmt->fetchObject());
@ -165,7 +165,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetchPairs() public function testFetchPairs()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$resultMock = $this->getMockBuilder('mysqli_result') $resultMock = $this->getMockBuilder('mysqli_result')
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -206,9 +206,8 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetchWithDebug() public function testFetchWithDebug()
{ {
if (!defined('DEBUG')) {
define('DEBUG', true);
}
Config::set('PROFILER', true);
Config::set('PROFILER_DETAILS', true);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->assertSame('OBJECT', $this->stmt->fetch()); $this->assertSame('OBJECT', $this->stmt->fetch());
@ -220,7 +219,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testClose() public function testClose()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->assertAttributeEquals(null, 'result', $this->stmt); $this->assertAttributeEquals(null, 'result', $this->stmt);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
@ -261,7 +260,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
public function testNumRows() public function testNumRows()
{ {
$this->markTestSkipped('Unable to execute a method or access a property of an incomplete object.'); $this->markTestSkipped('Unable to execute a method or access a property of an incomplete object.');
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->assertNull($this->stmt->numRows()); $this->assertNull($this->stmt->numRows());
@ -273,7 +272,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/ */
public function testFetchInvalidMode() public function testFetchInvalidMode()
{ {
Config::set('DEBUG', false);
Config::set('PROFILER_DETAILS', false);
$this->setDriverGetConnectionMethod(); $this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));

Loading…
Cancel
Save