Browse Source

Modified MySQLiStatementTest with use PROFILER_DETAILS set.

master
Alexander Demidov 12 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()
{
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'));

Loading…
Cancel
Save