Skip to content

Commit

Permalink
Clean up test table in Connection Test to prevent unnecessary failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Fischer committed Dec 23, 2014
1 parent bedc466 commit 4569953
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/lib/db/connection.php
Expand Up @@ -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();
Expand Down

0 comments on commit 4569953

Please sign in to comment.