mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add unit tests for DB class equivalence and magic properties
This commit is contained in:
parent
28bc991048
commit
7755821f20
1 changed files with 12 additions and 0 deletions
|
|
@ -12,10 +12,22 @@ class DBTest extends \Codeception\TestCase\Test
|
|||
{
|
||||
$oDB = Rhymix\Framework\DB::getInstance();
|
||||
$this->assertTrue($oDB instanceof Rhymix\Framework\DB);
|
||||
$this->assertEquals($oDB, \DB::getInstance());
|
||||
$this->assertTrue(\DB::getInstance() instanceof \DB);
|
||||
$this->assertTrue($oDB->isConnected());
|
||||
$this->assertTrue($oDB->getHandle() instanceof Rhymix\Framework\Helpers\DBHelper);
|
||||
}
|
||||
|
||||
public function testCompatProperties()
|
||||
{
|
||||
$oDB = Rhymix\Framework\DB::getInstance();
|
||||
$this->assertEquals('mysql', $oDB->db_type);
|
||||
$this->assertEquals($oDB->getHandle()->getAttribute(\PDO::ATTR_SERVER_VERSION), $oDB->db_version);
|
||||
$this->assertEquals(Rhymix\Framework\Config::get('db.master.prefix'), $oDB->prefix);
|
||||
$this->assertTrue($oDB->use_prepared_statements);
|
||||
$this->assertNull($oDB->some_nonexistent_property);
|
||||
}
|
||||
|
||||
public function testPrepare()
|
||||
{
|
||||
$oDB = Rhymix\Framework\DB::getInstance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue