From 2395adf7b875c6f32f7f0f25ac4d8f20ad0935e1 Mon Sep 17 00:00:00 2001 From: Alexander Demidov Date: Tue, 10 Jul 2012 13:49:49 +0400 Subject: [PATCH] Modified MySQLiStatementTest with use PROFILER_DETAILS set. --- tests/model/MySQLiStatementTest.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/model/MySQLiStatementTest.php b/tests/model/MySQLiStatementTest.php index 5539796..38b0aba 100644 --- a/tests/model/MySQLiStatementTest.php +++ b/tests/model/MySQLiStatementTest.php @@ -83,7 +83,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testExecute() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->driver ->expects($this->any()) @@ -102,7 +102,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testExecuteNoPlaceholders() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->setDriverGetConnectionMethod(); $this->sql = 'PLAIN SQL'; @@ -116,7 +116,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetchNoResult() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->assertFalse($this->stmt->fetch()); } @@ -126,7 +126,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testDriverExecuteNoResult() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->setDriverGetConnectionWrongResultMethod(); $this->setExpectedException('GeneralException', 'ERROR'); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); @@ -138,7 +138,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetch() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->setDriverGetConnectionMethod(); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->assertSame('OBJECT', $this->stmt->fetch()); @@ -153,7 +153,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetchObject() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->setDriverGetConnectionMethod(); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->assertSame('OBJECT', $this->stmt->fetchObject()); @@ -165,7 +165,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetchPairs() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $resultMock = $this->getMockBuilder('mysqli_result') ->disableOriginalConstructor() @@ -206,9 +206,8 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetchWithDebug() { - if (!defined('DEBUG')) { - define('DEBUG', true); - } + Config::set('PROFILER', true); + Config::set('PROFILER_DETAILS', true); $this->setDriverGetConnectionMethod(); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->assertSame('OBJECT', $this->stmt->fetch()); @@ -220,7 +219,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testClose() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->assertAttributeEquals(null, 'result', $this->stmt); $this->setDriverGetConnectionMethod(); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); @@ -261,7 +260,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase public function testNumRows() { $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->stmt->execute(array('place' => 'place_val', 'new' => 'new_val')); $this->assertNull($this->stmt->numRows()); @@ -273,7 +272,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase */ public function testFetchInvalidMode() { - Config::set('DEBUG', false); + Config::set('PROFILER_DETAILS', false); $this->setDriverGetConnectionMethod(); $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));