Replace constant DEBUG to use in Config. Remove start profiler from FrontController (moved to bootstrap).
This commit is contained in:
@ -114,9 +114,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFind()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||
@ -145,9 +143,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testOrderSkipLimit()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
|
||||
@ -184,9 +180,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(5, $mongo->count('items'));
|
||||
$this->assertEquals(2, $mongo->count('items', array('name' => 'eggs')));
|
||||
@ -199,9 +193,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCursorCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(5, $mongo->find('items')->count(5));
|
||||
$this->assertCount(3, $mongo->find('items')->limit(3)->fetchAll());
|
||||
@ -214,9 +206,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$eggs = $mongo->get('items', array('name' => 'eggs'))->fetchObject();
|
||||
@ -232,9 +222,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testRemove()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||
@ -250,9 +238,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testInsert()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||
@ -269,9 +255,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testBatchInsert()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$data = array(
|
||||
array('name' => 'first object'),
|
||||
@ -292,9 +276,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetInsertId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(0, $mongo->getInsertId());
|
||||
@ -316,9 +298,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||
@ -336,9 +316,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testUpsert()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
|
||||
@ -353,9 +331,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFindAndModify()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
|
||||
@ -371,9 +347,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFindAndModifyNoItem()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
|
||||
@ -389,9 +363,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testEvalCommand()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$result = $mongo->command('items', array('$eval' => 'function() { return db.items.count();}'));
|
||||
$this->assertEquals(5, $result->fetch());
|
||||
@ -406,9 +378,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testEval()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$result = $mongo->command('items', array('$eval' => 'function() {return true; }'));
|
||||
$this->assertTrue($result->fetch());
|
||||
@ -424,9 +394,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCommand()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$result = $mongo->command('items', array('distinct' => 'items', 'key' => 'name'));
|
||||
$this->assertEquals(4, count($result->fetch(DB::FETCH_ASSOC)));
|
||||
|
@ -64,9 +64,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFind()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$result = $this->model->find();
|
||||
$this->assertInstanceOf('MongoStatement', $result);
|
||||
$this->assertEquals('milk', $result->limit(2)->order(array('name' => -1))->fetch()->name);
|
||||
@ -83,9 +81,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
||||
$result = $result->fetch();
|
||||
$this->assertEquals('bread', $result->name);
|
||||
@ -99,9 +95,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
||||
$id = $result->fetch()->_id;
|
||||
$this->assertEquals(1, $this->model->delete($id));
|
||||
@ -114,9 +108,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testBatchInsert()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$data = array(
|
||||
array('name' => 'first object'),
|
||||
array('name' => 'second object'),
|
||||
@ -135,9 +127,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDeleteAll()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
||||
$this->assertEquals(0, $this->model->deleteAll(array('name' => 'eggs')));
|
||||
@ -150,9 +140,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->assertEquals(5, $this->model->count());
|
||||
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
||||
}
|
||||
@ -163,9 +151,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetch()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$mock = $this->getMock('CacheKey', array('set', 'get'));
|
||||
$mock->expects($this->exactly(3))
|
||||
@ -204,9 +190,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testUseMongoId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$this->assertAttributeEquals(true, 'useMongoId', $this->model);
|
||||
}
|
||||
@ -217,9 +201,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$class = new ReflectionClass('MongoModel');
|
||||
$prop = $class->getProperty('useMongoId');
|
||||
$prop->setAccessible(true);
|
||||
@ -239,9 +221,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testIdToMongoId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$this->model->insert(array('name' => 'testbread', 'price' => 3.2, 'quantity' => 10));
|
||||
$this->model->insert(array('name' => 'testbread', 'price' => 12, 'quantity' => 2));
|
||||
|
@ -61,9 +61,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testAffectedNumRowsNoResult()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->assertFalse($this->stmt->affectedRows());
|
||||
$this->assertFalse($this->stmt->numRows());
|
||||
|
||||
@ -82,9 +80,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testAffectedNumRows()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
@ -100,9 +96,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetInsertId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
|
||||
$this->request = $this->getMockBuilder('InsertMongoCommand')
|
||||
@ -131,9 +125,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecute()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
||||
$this->assertTrue($this->stmt->execute());
|
||||
@ -145,9 +137,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecuteNoResult()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->any())
|
||||
@ -163,9 +153,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecuteNoConnection()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->driver
|
||||
->expects($this->any())
|
||||
->method('getConnection')
|
||||
@ -180,9 +168,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecuteWithDebug()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
||||
$this->assertTrue($this->stmt->execute());
|
||||
$this->assertEquals(10, $this->stmt->numRows());
|
||||
@ -194,9 +180,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testBindParam()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
@ -217,9 +201,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetch()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
|
||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||
@ -236,9 +218,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchWithInitialArray()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
|
||||
$this->setDriverGetConnectionMethod();
|
||||
@ -257,9 +237,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchAssocFromCursor()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
|
||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||
@ -276,9 +254,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchAssocFromArray()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
|
||||
$this->setDriverGetConnectionMethod();
|
||||
@ -298,9 +274,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchWrongMode()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
|
||||
$this->setDriverGetConnectionMethod();
|
||||
@ -320,9 +294,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testSkipOrderLimit()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||
|
||||
$this->stmt->execute();
|
||||
@ -340,9 +312,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||
|
||||
$this->stmt->execute();
|
||||
@ -357,9 +327,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCountException()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
@ -377,9 +345,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testOrderException()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
@ -397,9 +363,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testSkipException()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
@ -417,9 +381,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLimitException()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', true);
|
||||
}
|
||||
Config::set('DEBUG', 1;
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->request
|
||||
->expects($this->once())
|
||||
|
@ -57,9 +57,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testDriver()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -78,9 +76,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testGetConnection()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
$this->assertInstanceOf('mysqli', $driver->getConnection());
|
||||
@ -91,9 +87,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testGetConnectionWrongConfig()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->conf['database'] = 'nodb';
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -106,9 +100,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testDisconnect()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -125,9 +117,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testInsert()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -147,9 +137,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testGetInsertId()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -161,9 +149,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testTransaction()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
@ -194,9 +180,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
||||
*/
|
||||
public function testRollback()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$driver = new MySQLiDriver($this->conf);
|
||||
|
||||
|
@ -81,9 +81,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecute()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$this->driver
|
||||
->expects($this->any())
|
||||
@ -102,9 +100,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testExecuteNoPlaceholders()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
|
||||
$this->sql = 'PLAIN SQL';
|
||||
@ -118,9 +114,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchNoResult()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->assertFalse($this->stmt->fetch());
|
||||
}
|
||||
|
||||
@ -130,9 +124,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDriverExecuteNoResult()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionWrongResultMethod();
|
||||
$this->setExpectedException('GeneralException', 'ERROR');
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
@ -144,9 +136,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetch()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
$this->assertSame('OBJECT', $this->stmt->fetch());
|
||||
@ -161,9 +151,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchObject()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
$this->assertSame('OBJECT', $this->stmt->fetchObject());
|
||||
@ -175,9 +163,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchPairs()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
|
||||
$resultMock = $this->getMockBuilder('mysqli_result')
|
||||
->disableOriginalConstructor()
|
||||
@ -232,9 +218,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testClose()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->assertAttributeEquals(null, 'result', $this->stmt);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
@ -275,9 +259,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.');
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
$this->assertNull($this->stmt->numRows());
|
||||
@ -289,9 +271,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFetchInvalidMode()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
Config::set('DEBUG', 0);
|
||||
$this->setDriverGetConnectionMethod();
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
|
||||
|
Reference in New Issue
Block a user