1
0
Fork 0
Dieser Commit ist enthalten in:
DSB 2011-06-10 21:55:32 +00:00
Ursprung 2b21070b1a
Commit f7a7c71f86
1583 geänderte Dateien mit 454759 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,36 @@
<?php
/**
* @group database
*/
class Msd_DbTest extends ControllerTestCase
{
public function setUp()
{
$this->loginUser();
}
public function testCanGetMysqliInstance()
{
$dbo = Msd_Db::getAdapter();
$this->assertInstanceOf('Msd_Db_Mysqli', $dbo);
}
public function testCanGetMysqlInstance()
{
$dbo = Msd_Db::getAdapter(null, true);
$this->assertInstanceOf('Msd_Db_Mysql', $dbo);
}
public function testThrowsExceptionOnInvalidQuery()
{
$dbo = Msd_Db::getAdapter();
try {
$dbo->query('I am not a valid query');
} catch (Exception $e) {
$this->assertInstanceOf('Msd_Exception', $e);
$this->assertEquals(1064, $e->getCode());
return;
}
$this->fail('An expected exception has not been raised.');
}
}