mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add unit tests for DB->connect() and disconnect()
This commit is contained in:
parent
31f2d54f1a
commit
e238947c9a
1 changed files with 17 additions and 1 deletions
|
|
@ -14,10 +14,26 @@ class DBTest extends \Codeception\TestCase\Test
|
|||
$this->assertTrue($oDB instanceof Rhymix\Framework\DB);
|
||||
$this->assertEquals($oDB, \DB::getInstance());
|
||||
$this->assertTrue(\DB::getInstance() instanceof Rhymix\Framework\DB);
|
||||
$this->assertTrue($oDB->isConnected());
|
||||
$this->assertTrue($oDB->getHandle() instanceof Rhymix\Framework\Helpers\DBHelper);
|
||||
}
|
||||
|
||||
public function testConnectDisconnect()
|
||||
{
|
||||
$oDB = Rhymix\Framework\DB::getInstance('master');
|
||||
$this->assertTrue(is_object($oDB->getHandle()));
|
||||
|
||||
$oDB->disconnect();
|
||||
$this->assertTrue(is_null($oDB->getHandle()));
|
||||
$this->assertFalse($oDB->isConnected());
|
||||
|
||||
$oDB->connect(config('db.master'));
|
||||
$this->assertTrue(is_object($oDB->getHandle()));
|
||||
$this->assertTrue($oDB->isConnected());
|
||||
|
||||
$oDB = Rhymix\Framework\DB::getInstance('master');
|
||||
$this->assertTrue(is_object($oDB->getHandle()));
|
||||
}
|
||||
|
||||
public function testCompatProperties()
|
||||
{
|
||||
$oDB = Rhymix\Framework\DB::getInstance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue