Replace 0 to false and 1 to true in Config:;set(DEBUG...) in majestic tests.
This commit is contained in:
@ -166,7 +166,7 @@ class LoadTest extends PHPUnit_Framework_TestCase
|
|||||||
$autoload = require(self::$file);
|
$autoload = require(self::$file);
|
||||||
$this->assertNotEmpty($autoload);
|
$this->assertNotEmpty($autoload);
|
||||||
|
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
Load::autoload('Some');
|
Load::autoload('Some');
|
||||||
Load::autoload('DbDriver');
|
Load::autoload('DbDriver');
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ class ActionTest extends Action_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testActionConstructWithParams()
|
public function testActionConstructWithParams()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('param1' => 'value1', 'param2' => 'value2'));
|
Env::setParams(array('param1' => 'value1', 'param2' => 'value2'));
|
||||||
$action = $this->getMockForAbstractClass('Action' );
|
$action = $this->getMockForAbstractClass('Action' );
|
||||||
$this->assertSame('value1', $action->param1);
|
$this->assertSame('value1', $action->param1);
|
||||||
@ -31,7 +31,7 @@ class ActionTest extends Action_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetch()
|
public function testFetch()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$load = new ReflectionClass('Load');
|
$load = new ReflectionClass('Load');
|
||||||
$classes = $load->getProperty('autoload');
|
$classes = $load->getProperty('autoload');
|
||||||
$classes->setAccessible(true);
|
$classes->setAccessible(true);
|
||||||
@ -49,7 +49,7 @@ class ActionTest extends Action_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchNoTemplate()
|
public function testFetchNoTemplate()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('template' => ''));
|
Env::setParams(array('template' => ''));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
@ -65,7 +65,7 @@ class ActionTest extends Action_TestCase
|
|||||||
{
|
{
|
||||||
set_exit_overload(function() { return false; });
|
set_exit_overload(function() { return false; });
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$load = new ReflectionClass('Action');
|
$load = new ReflectionClass('Action');
|
||||||
$redirect = $load->getMethod('redirect');
|
$redirect = $load->getMethod('redirect');
|
||||||
$redirect->setAccessible(true);
|
$redirect->setAccessible(true);
|
||||||
|
@ -22,7 +22,7 @@ class AjaxActionTest extends Action_TestCase
|
|||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('ajax' => 'AjaxTemplate', 'param2' => 'value2'));
|
Env::setParams(array('ajax' => 'AjaxTemplate', 'param2' => 'value2'));
|
||||||
$action = $this->getMockForAbstractClass('AjaxAction' );
|
$action = $this->getMockForAbstractClass('AjaxAction' );
|
||||||
$this->assertAttributeEquals('ajax', 'template', $action);
|
$this->assertAttributeEquals('ajax', 'template', $action);
|
||||||
@ -34,7 +34,7 @@ class AjaxActionTest extends Action_TestCase
|
|||||||
public function testFetchWithEncode()
|
public function testFetchWithEncode()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
$action = $this->getMockForAbstractClass('AjaxAction' );
|
$action = $this->getMockForAbstractClass('AjaxAction' );
|
||||||
@ -50,7 +50,7 @@ class AjaxActionTest extends Action_TestCase
|
|||||||
public function testFetchNoEncode()
|
public function testFetchNoEncode()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('encode' => false));
|
Env::setParams(array('encode' => false));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
|
@ -81,7 +81,7 @@ class ErrorActionTest extends Action_TestCase
|
|||||||
public function testFetchNoTemplate()
|
public function testFetchNoTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$exception = $this->getMock('ErrorException');
|
$exception = $this->getMock('ErrorException');
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
|
@ -22,7 +22,7 @@ class PagerActionTest extends Action_TestCase
|
|||||||
public function testConstructWithParams()
|
public function testConstructWithParams()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$action = $this->getMockForAbstractClass('PagerAction');
|
$action = $this->getMockForAbstractClass('PagerAction');
|
||||||
$this->assertSame(20, $action->getLimit());
|
$this->assertSame(20, $action->getLimit());
|
||||||
$action = $this->getMockForAbstractClass('PagerAction', array(50));
|
$action = $this->getMockForAbstractClass('PagerAction', array(50));
|
||||||
@ -35,7 +35,7 @@ class PagerActionTest extends Action_TestCase
|
|||||||
public function testSetCount()
|
public function testSetCount()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$action = $this->getMockForAbstractClass('PagerAction');
|
$action = $this->getMockForAbstractClass('PagerAction');
|
||||||
$action->setCount(50);
|
$action->setCount(50);
|
||||||
$this->assertSame(1, $action->page);
|
$this->assertSame(1, $action->page);
|
||||||
@ -59,7 +59,7 @@ class PagerActionTest extends Action_TestCase
|
|||||||
public function testGetOffset()
|
public function testGetOffset()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$action = $this->getMockForAbstractClass('PagerAction');
|
$action = $this->getMockForAbstractClass('PagerAction');
|
||||||
$this->assertSame(0, $action->getOffset());
|
$this->assertSame(0, $action->getOffset());
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ class PagerActionTest extends Action_TestCase
|
|||||||
public function testFetchNoTemplate()
|
public function testFetchNoTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('template' => ''));
|
Env::setParams(array('template' => ''));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
@ -85,7 +85,7 @@ class PagerActionTest extends Action_TestCase
|
|||||||
public function testFetchWithTemplate()
|
public function testFetchWithTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('template' => 'SomeTemplate'));
|
Env::setParams(array('template' => 'SomeTemplate'));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
|
@ -22,7 +22,7 @@ class StaticActionTest extends Action_TestCase
|
|||||||
public function testFetchNoTemplate()
|
public function testFetchNoTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('template' => ''));
|
Env::setParams(array('template' => ''));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
@ -37,7 +37,7 @@ class StaticActionTest extends Action_TestCase
|
|||||||
public function testFetchWithTemplate()
|
public function testFetchWithTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
Env::setParams(array('template' => 'SomeTemplate'));
|
Env::setParams(array('template' => 'SomeTemplate'));
|
||||||
$controller = FrontController::getInstance();
|
$controller = FrontController::getInstance();
|
||||||
$controller->setView('SomeView');
|
$controller->setView('SomeView');
|
||||||
|
@ -25,7 +25,7 @@ class EnvTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testGetRequestUri()
|
public function testGetRequestUri()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$_SERVER['REQUEST_URI'] = '/test/index.php?id=1&test=wet&id_theme=512';
|
$_SERVER['REQUEST_URI'] = '/test/index.php?id=1&test=wet&id_theme=512';
|
||||||
$this->assertSame('/test/index.php', Env::getRequestUri());
|
$this->assertSame('/test/index.php', Env::getRequestUri());
|
||||||
$_SERVER['REQUEST_URI'] = '/tes?t/index.php?id=1&test=wet&id_theme=512';
|
$_SERVER['REQUEST_URI'] = '/tes?t/index.php?id=1&test=wet&id_theme=512';
|
||||||
@ -38,7 +38,7 @@ class EnvTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testTrimBaseRequestUri()
|
public function testTrimBaseRequestUri()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$class = new ReflectionClass('Env');
|
$class = new ReflectionClass('Env');
|
||||||
$this->started = $class->getProperty('request');
|
$this->started = $class->getProperty('request');
|
||||||
$this->started->setAccessible(true);
|
$this->started->setAccessible(true);
|
||||||
|
@ -43,7 +43,7 @@ class ErrorLayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testSetException()
|
public function testSetException()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$layout = new ErrorLayout();
|
$layout = new ErrorLayout();
|
||||||
$layout->setException(new GeneralException());
|
$layout->setException(new GeneralException());
|
||||||
$this->assertAttributeInstanceOf('GeneralException', 'exception', $layout);
|
$this->assertAttributeInstanceOf('GeneralException', 'exception', $layout);
|
||||||
@ -52,7 +52,7 @@ class ErrorLayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testExecute()
|
public function testExecute()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$action = $this->getMock('Action', array('fetch'));
|
$action = $this->getMock('Action', array('fetch'));
|
||||||
$action->expects($this->once())
|
$action->expects($this->once())
|
||||||
->method('fetch')
|
->method('fetch')
|
||||||
|
@ -43,7 +43,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testConstruct()
|
public function testConstruct()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$layout = $this->getMockForAbstractClass('Layout');
|
$layout = $this->getMockForAbstractClass('Layout');
|
||||||
$this->assertAttributeInstanceOf('PHPView', 'view', $layout);
|
$this->assertAttributeInstanceOf('PHPView', 'view', $layout);
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testFetch()
|
public function testFetch()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$layout = $this->getMockForAbstractClass('Layout');
|
$layout = $this->getMockForAbstractClass('Layout');
|
||||||
|
|
||||||
$action = $this->getMock('Action', array('fetch'));
|
$action = $this->getMock('Action', array('fetch'));
|
||||||
@ -65,7 +65,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testFetchWithTemplate()
|
public function testFetchWithTemplate()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$layout = $this->getMockForAbstractClass('Layout');
|
$layout = $this->getMockForAbstractClass('Layout');
|
||||||
|
|
||||||
$class = new ReflectionClass('Layout');
|
$class = new ReflectionClass('Layout');
|
||||||
@ -89,7 +89,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||||||
public function testAppend()
|
public function testAppend()
|
||||||
{
|
{
|
||||||
|
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$layout = $this->getMockForAbstractClass('Layout', array('append', 'prepend'), 'LayoutMock');
|
$layout = $this->getMockForAbstractClass('Layout', array('append', 'prepend'), 'LayoutMock');
|
||||||
$action = $this->getMock('Action', array('fetch'));
|
$action = $this->getMock('Action', array('fetch'));
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCannotWrite()
|
public function testCannotWrite()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$conf = array('logger' => 'FileLogger', 'filepath' => '/log.txt');
|
$conf = array('logger' => 'FileLogger', 'filepath' => '/log.txt');
|
||||||
Config::set('Logger', $conf);
|
Config::set('Logger', $conf);
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testLog()
|
public function testLog()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFileNotExists($this->conf['filepath']);
|
$this->assertFileNotExists($this->conf['filepath']);
|
||||||
$logger = Logger::getInstance();
|
$logger = Logger::getInstance();
|
||||||
$logger->setPid(123);
|
$logger->setPid(123);
|
||||||
@ -83,7 +83,7 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDestruct()
|
public function testDestruct()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$my_pid = posix_getpid();
|
$my_pid = posix_getpid();
|
||||||
$fd_command = 'lsof -n -p ' . $my_pid . ' | wc -l';
|
$fd_command = 'lsof -n -p ' . $my_pid . ' | wc -l';
|
||||||
$fd_count_start = (int) `$fd_command`;
|
$fd_count_start = (int) `$fd_command`;
|
||||||
|
@ -114,7 +114,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFind()
|
public function testFind()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||||
@ -143,7 +143,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testOrderSkipLimit()
|
public function testOrderSkipLimit()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCount()
|
public function testCount()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(5, $mongo->count('items'));
|
$this->assertEquals(5, $mongo->count('items'));
|
||||||
$this->assertEquals(2, $mongo->count('items', array('name' => 'eggs')));
|
$this->assertEquals(2, $mongo->count('items', array('name' => 'eggs')));
|
||||||
@ -193,7 +193,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCursorCount()
|
public function testCursorCount()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(5, $mongo->find('items')->count(5));
|
$this->assertEquals(5, $mongo->find('items')->count(5));
|
||||||
$this->assertCount(3, $mongo->find('items')->limit(3)->fetchAll());
|
$this->assertCount(3, $mongo->find('items')->limit(3)->fetchAll());
|
||||||
@ -206,7 +206,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGet()
|
public function testGet()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$eggs = $mongo->get('items', array('name' => 'eggs'))->fetchObject();
|
$eggs = $mongo->get('items', array('name' => 'eggs'))->fetchObject();
|
||||||
@ -222,7 +222,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testRemove()
|
public function testRemove()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||||
@ -238,7 +238,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testInsert()
|
public function testInsert()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||||
@ -255,7 +255,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testBatchInsert()
|
public function testBatchInsert()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
array('name' => 'first object'),
|
array('name' => 'first object'),
|
||||||
@ -276,7 +276,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInsertId()
|
public function testGetInsertId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(0, $mongo->getInsertId());
|
$this->assertEquals(0, $mongo->getInsertId());
|
||||||
@ -298,7 +298,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
$this->assertEquals(1, $mongo->find('items', array('name' => 'bread'))->numRows());
|
||||||
@ -316,7 +316,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpsert()
|
public function testUpsert()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFindAndModify()
|
public function testFindAndModify()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFindAndModifyNoItem()
|
public function testFindAndModifyNoItem()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testEvalCommand()
|
public function testEvalCommand()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$result = $mongo->command('items', array('$eval' => 'function() { return db.items.count();}'));
|
$result = $mongo->command('items', array('$eval' => 'function() { return db.items.count();}'));
|
||||||
$this->assertEquals(5, $result->fetch());
|
$this->assertEquals(5, $result->fetch());
|
||||||
@ -378,7 +378,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testEval()
|
public function testEval()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$result = $mongo->command('items', array('$eval' => 'function() {return true; }'));
|
$result = $mongo->command('items', array('$eval' => 'function() {return true; }'));
|
||||||
$this->assertTrue($result->fetch());
|
$this->assertTrue($result->fetch());
|
||||||
@ -394,7 +394,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCommand()
|
public function testCommand()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$mongo = new MongoDriver($this->conf);
|
$mongo = new MongoDriver($this->conf);
|
||||||
$result = $mongo->command('items', array('distinct' => 'items', 'key' => 'name'));
|
$result = $mongo->command('items', array('distinct' => 'items', 'key' => 'name'));
|
||||||
$this->assertEquals(4, count($result->fetch(DB::FETCH_ASSOC)));
|
$this->assertEquals(4, count($result->fetch(DB::FETCH_ASSOC)));
|
||||||
|
@ -64,7 +64,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFind()
|
public function testFind()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$result = $this->model->find();
|
$result = $this->model->find();
|
||||||
$this->assertInstanceOf('MongoStatement', $result);
|
$this->assertInstanceOf('MongoStatement', $result);
|
||||||
$this->assertEquals('milk', $result->limit(2)->order(array('name' => -1))->fetch()->name);
|
$this->assertEquals('milk', $result->limit(2)->order(array('name' => -1))->fetch()->name);
|
||||||
@ -81,7 +81,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGet()
|
public function testGet()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
||||||
$result = $result->fetch();
|
$result = $result->fetch();
|
||||||
$this->assertEquals('bread', $result->name);
|
$this->assertEquals('bread', $result->name);
|
||||||
@ -95,7 +95,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDelete()
|
public function testDelete()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
$result = $this->model->find()->limit(1)->order(array('name' => 1));
|
||||||
$id = $result->fetch()->_id;
|
$id = $result->fetch()->_id;
|
||||||
$this->assertEquals(1, $this->model->delete($id));
|
$this->assertEquals(1, $this->model->delete($id));
|
||||||
@ -108,7 +108,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testBatchInsert()
|
public function testBatchInsert()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$data = array(
|
$data = array(
|
||||||
array('name' => 'first object'),
|
array('name' => 'first object'),
|
||||||
array('name' => 'second object'),
|
array('name' => 'second object'),
|
||||||
@ -127,7 +127,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDeleteAll()
|
public function testDeleteAll()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
||||||
$this->assertEquals(0, $this->model->deleteAll(array('name' => 'eggs')));
|
$this->assertEquals(0, $this->model->deleteAll(array('name' => 'eggs')));
|
||||||
@ -140,7 +140,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCount()
|
public function testCount()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->assertEquals(5, $this->model->count());
|
$this->assertEquals(5, $this->model->count());
|
||||||
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetch()
|
public function testFetch()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$mock = $this->getMock('CacheKey', array('set', 'get'));
|
$mock = $this->getMock('CacheKey', array('set', 'get'));
|
||||||
$mock->expects($this->exactly(3))
|
$mock->expects($this->exactly(3))
|
||||||
@ -190,7 +190,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testUseMongoId()
|
public function testUseMongoId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$this->assertAttributeEquals(true, 'useMongoId', $this->model);
|
$this->assertAttributeEquals(true, 'useMongoId', $this->model);
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testId()
|
public function testId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$class = new ReflectionClass('MongoModel');
|
$class = new ReflectionClass('MongoModel');
|
||||||
$prop = $class->getProperty('useMongoId');
|
$prop = $class->getProperty('useMongoId');
|
||||||
$prop->setAccessible(true);
|
$prop->setAccessible(true);
|
||||||
@ -221,7 +221,7 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testIdToMongoId()
|
public function testIdToMongoId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$this->model->insert(array('name' => 'testbread', 'price' => 3.2, 'quantity' => 10));
|
$this->model->insert(array('name' => 'testbread', 'price' => 3.2, 'quantity' => 10));
|
||||||
$this->model->insert(array('name' => 'testbread', 'price' => 12, 'quantity' => 2));
|
$this->model->insert(array('name' => 'testbread', 'price' => 12, 'quantity' => 2));
|
||||||
|
@ -63,7 +63,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testAffectedNumRowsNoResult()
|
public function testAffectedNumRowsNoResult()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->assertFalse($this->stmt->affectedRows());
|
$this->assertFalse($this->stmt->affectedRows());
|
||||||
$this->assertFalse($this->stmt->numRows());
|
$this->assertFalse($this->stmt->numRows());
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testAffectedNumRows()
|
public function testAffectedNumRows()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -98,7 +98,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInsertId()
|
public function testGetInsertId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
|
|
||||||
$this->request = $this->getMockBuilder('InsertMongoCommand')
|
$this->request = $this->getMockBuilder('InsertMongoCommand')
|
||||||
@ -127,7 +127,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecute()
|
public function testExecute()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
||||||
$this->assertTrue($this->stmt->execute());
|
$this->assertTrue($this->stmt->execute());
|
||||||
@ -139,7 +139,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecuteNoResult()
|
public function testExecuteNoResult()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
@ -155,7 +155,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecuteNoConnection()
|
public function testExecuteNoConnection()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->driver
|
$this->driver
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getConnection')
|
->method('getConnection')
|
||||||
@ -170,7 +170,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecuteWithDebug()
|
public function testExecuteWithDebug()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
|
||||||
$this->assertTrue($this->stmt->execute());
|
$this->assertTrue($this->stmt->execute());
|
||||||
$this->assertEquals(10, $this->stmt->numRows());
|
$this->assertEquals(10, $this->stmt->numRows());
|
||||||
@ -182,7 +182,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testBindParam()
|
public function testBindParam()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
|
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -203,7 +203,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetch()
|
public function testFetch()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFalse($this->stmt->fetch());
|
$this->assertFalse($this->stmt->fetch());
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||||
@ -220,7 +220,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchWithInitialArray()
|
public function testFetchWithInitialArray()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFalse($this->stmt->fetch());
|
$this->assertFalse($this->stmt->fetch());
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
@ -239,7 +239,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchAssocFromCursor()
|
public function testFetchAssocFromCursor()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFalse($this->stmt->fetch());
|
$this->assertFalse($this->stmt->fetch());
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||||
@ -256,7 +256,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchAssocFromArray()
|
public function testFetchAssocFromArray()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFalse($this->stmt->fetch());
|
$this->assertFalse($this->stmt->fetch());
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
@ -276,7 +276,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchWrongMode()
|
public function testFetchWrongMode()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->assertFalse($this->stmt->fetch());
|
$this->assertFalse($this->stmt->fetch());
|
||||||
|
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
@ -296,7 +296,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testSkipOrderLimit()
|
public function testSkipOrderLimit()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||||
|
|
||||||
$this->stmt->execute();
|
$this->stmt->execute();
|
||||||
@ -314,7 +314,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCount()
|
public function testCount()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
$this->setDriverGetConnectionMethod()->setRequestForFetch();
|
||||||
|
|
||||||
$this->stmt->execute();
|
$this->stmt->execute();
|
||||||
@ -329,7 +329,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCountException()
|
public function testCountException()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -347,7 +347,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testOrderException()
|
public function testOrderException()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -365,7 +365,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testSkipException()
|
public function testSkipException()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
@ -383,7 +383,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testLimitException()
|
public function testLimitException()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->setDriverGetConnectionMethod();
|
$this->setDriverGetConnectionMethod();
|
||||||
$this->request
|
$this->request
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
|
@ -57,7 +57,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDriver()
|
public function testDriver()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetConnection()
|
public function testGetConnection()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
$this->assertInstanceOf('mysqli', $driver->getConnection());
|
$this->assertInstanceOf('mysqli', $driver->getConnection());
|
||||||
@ -87,7 +87,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetConnectionWrongConfig()
|
public function testGetConnectionWrongConfig()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->conf['database'] = 'nodb';
|
$this->conf['database'] = 'nodb';
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testDisconnect()
|
public function testDisconnect()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testInsert()
|
public function testInsert()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInsertId()
|
public function testGetInsertId()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testTransaction()
|
public function testTransaction()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ class MySQLiDriverTest extends PHPUnit_Extensions_Database_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testRollback()
|
public function testRollback()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$driver = new MySQLiDriver($this->conf);
|
$driver = new MySQLiDriver($this->conf);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testExecute()
|
public function testExecute()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', 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', 0);
|
Config::set('DEBUG', false);
|
||||||
|
|
||||||
$resultMock = $this->getMockBuilder('mysqli_result')
|
$resultMock = $this->getMockBuilder('mysqli_result')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@ -220,7 +220,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testClose()
|
public function testClose()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', 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 +261,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', 0);
|
Config::set('DEBUG', 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 +273,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFetchInvalidMode()
|
public function testFetchInvalidMode()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', 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'));
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCallSimpleParams()
|
public function testCallSimpleParams()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$mock = $this->getMock('Redis', array('connect'));
|
$mock = $this->getMock('Redis', array('connect'));
|
||||||
|
|
||||||
$mock->expects($this->once())
|
$mock->expects($this->once())
|
||||||
@ -77,7 +77,7 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCallArrayParam()
|
public function testCallArrayParam()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$mock = $this->getMock('Redis', array('connect'));
|
$mock = $this->getMock('Redis', array('connect'));
|
||||||
|
|
||||||
$mock->expects($this->once())
|
$mock->expects($this->once())
|
||||||
@ -95,7 +95,7 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testCallUndefinedMethod()
|
public function testCallUndefinedMethod()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$mock = $this->getMock('Redis', array('connect'));
|
$mock = $this->getMock('Redis', array('connect'));
|
||||||
$redisDebug = new RedisDebug($mock);
|
$redisDebug = new RedisDebug($mock);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class RedisManagerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testConnectWithDebug()
|
public function testConnectWithDebug()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->getMock('RedisDebug');
|
$this->getMock('RedisDebug');
|
||||||
|
|
||||||
Config::set('Redis', array('new' => array('host' => true, 'port' => 2023, 'database' => true)));
|
Config::set('Redis', array('new' => array('host' => true, 'port' => 2023, 'database' => true)));
|
||||||
|
@ -38,7 +38,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInstaceNoDebug()
|
public function testGetInstaceNoDebug()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 0);
|
Config::set('DEBUG', false);
|
||||||
$this->setExpectedException('GeneralException', 'Need to turn on DEBUG before use.');
|
$this->setExpectedException('GeneralException', 'Need to turn on DEBUG before use.');
|
||||||
Profiler::getInstance();
|
Profiler::getInstance();
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetInstance()
|
public function testGetInstance()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
$this->assertInstanceOf('Profiler', $profiler);
|
$this->assertInstanceOf('Profiler', $profiler);
|
||||||
$this->assertSame($profiler, Profiler::getInstance());
|
$this->assertSame($profiler, Profiler::getInstance());
|
||||||
@ -59,7 +59,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testProfilerCommand()
|
public function testProfilerCommand()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
$cmdProfiler = $profiler->profilerCommand('command', 'type');
|
$cmdProfiler = $profiler->profilerCommand('command', 'type');
|
||||||
@ -71,7 +71,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testStartEndNoCommandProfiler()
|
public function testStartEndNoCommandProfiler()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
$profiler->start();
|
$profiler->start();
|
||||||
$result = $profiler->end('<body></body>');
|
$result = $profiler->end('<body></body>');
|
||||||
@ -89,7 +89,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testStartEndWithCommandProfiler()
|
public function testStartEndWithCommandProfiler()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
|
|
||||||
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
@ -107,7 +107,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetJSON()
|
public function testGetJSON()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
|
|
||||||
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
@ -120,7 +120,7 @@ class ProfilerTest extends PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetCLI()
|
public function testGetCLI()
|
||||||
{
|
{
|
||||||
Config::set('DEBUG', 1);
|
Config::set('DEBUG', true);
|
||||||
|
|
||||||
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
$this->getMock('CommandProfiler', array('getType', 'getCommand', 'getElapsed'), array(), 'CommandProfilerMock', false);
|
||||||
$profiler = Profiler::getInstance();
|
$profiler = Profiler::getInstance();
|
||||||
|
Reference in New Issue
Block a user