|
@ -14,12 +14,13 @@ require_once dirname(__FILE__) . '/../../Registry.php'; |
|
|
require_once dirname(__FILE__) . '/../../Config.php'; |
|
|
require_once dirname(__FILE__) . '/../../Config.php'; |
|
|
require_once dirname(__FILE__) . '/../../model/DbDriver.php'; |
|
|
require_once dirname(__FILE__) . '/../../model/DbDriver.php'; |
|
|
require_once dirname(__FILE__) . '/../../model/Db.php'; |
|
|
require_once dirname(__FILE__) . '/../../model/Db.php'; |
|
|
|
|
|
require_once dirname(__FILE__) . '/../../exception/GeneralException.php'; |
|
|
|
|
|
|
|
|
class DbTest extends PHPUnit_Framework_TestCase |
|
|
class DbTest extends PHPUnit_Framework_TestCase |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @expectedException Exception |
|
|
|
|
|
|
|
|
* @expectedException GeneralException |
|
|
* @expectedExceptionMessage Trying to get property of non-object |
|
|
* @expectedExceptionMessage Trying to get property of non-object |
|
|
*/ |
|
|
*/ |
|
|
public function testConnectNoParams() |
|
|
public function testConnectNoParams() |
|
@ -27,7 +28,7 @@ class DbTest extends PHPUnit_Framework_TestCase |
|
|
Db::connect(); |
|
|
Db::connect(); |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* @expectedException Exception |
|
|
|
|
|
|
|
|
* @expectedException GeneralException |
|
|
* @expectedExceptionMessage Connection parameters must be an array |
|
|
* @expectedExceptionMessage Connection parameters must be an array |
|
|
*/ |
|
|
*/ |
|
|
public function testConnectConfigNotArray() |
|
|
public function testConnectConfigNotArray() |
|
@ -51,7 +52,7 @@ class DbTest extends PHPUnit_Framework_TestCase |
|
|
$this->assertInstanceOf('DbDriver', $driver); |
|
|
$this->assertInstanceOf('DbDriver', $driver); |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* @expectedException Exception |
|
|
|
|
|
|
|
|
* @expectedException GeneralException |
|
|
* @expectedExceptionMessage Database driver must extends DbDriver |
|
|
* @expectedExceptionMessage Database driver must extends DbDriver |
|
|
*/ |
|
|
*/ |
|
|
public function testConnectWithWrongDriver() |
|
|
public function testConnectWithWrongDriver() |
|
|