markTestSkipped( 'The SQLite extension is not available.' ); } } public function testConnect() { $sqlite = new SQLiteConnection($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']); self::assertEquals(DatabaseStatus::OK, $sqlite->getStatus()); self::assertEquals($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database'], $sqlite->getDatabase()); self::assertInstanceOf('\phpOMS\DataStorage\Database\Query\Grammar\SQLiteGrammar', $sqlite->getGrammar()); } /** * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException */ public function testInvalidDatabaseType() { $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; unset($db['db']); $sqlite = new SQLiteConnection($db); } /** * @expectedException \phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException */ public function testInvalidDatabase() { $db = $GLOBALS['CONFIG']['db']['core']['sqlite']['admin']; unset($db['database']); $sqlite = new SQLiteConnection($db); } static function tearDownAfterClass() { if (\file_exists($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database'])) { \unlink($GLOBALS['CONFIG']['db']['core']['sqlite']['admin']['database']); } } }