Clean up test table in Connection Test to prevent unnecessary failures.

This commit is contained in:
Andreas Fischer 2014-12-23 01:01:58 +01:00
parent bedc4664e4
commit 4569953e5c
1 changed files with 19 additions and 0 deletions

View File

@ -18,6 +18,25 @@ class Connection extends \Test\TestCase {
*/
private $connection;
public static function setUpBeforeClass()
{
self::dropTestTable();
parent::setUpBeforeClass();
}
public static function tearDownAfterClass()
{
self::dropTestTable();
parent::tearDownAfterClass();
}
protected static function dropTestTable()
{
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') {
\OC_DB::dropTable('table');
}
}
public function setUp() {
parent::setUp();
$this->connection = \OC::$server->getDatabaseConnection();