diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php
index 070c75db55de5ec028b38503a0ecc0c0f702284c..720b448d0fbc72a05ea00478359f82dc089883d0 100644
--- a/tests/lib/db/connection.php
+++ b/tests/lib/db/connection.php
@@ -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();