summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-12-23 01:01:58 +0100
committerAndreas Fischer <bantu@owncloud.com>2014-12-23 01:01:58 +0100
commit4569953e5cde340b325a5aa3221bcb2135e1e428 (patch)
tree38ee4472663adc8ec18f4168b9f49cdde3624e22
parentbedc4664e41b542eae15b1038b22ace817fc447f (diff)
downloadnextcloud-server-4569953e5cde340b325a5aa3221bcb2135e1e428.tar.gz
nextcloud-server-4569953e5cde340b325a5aa3221bcb2135e1e428.zip
Clean up test table in Connection Test to prevent unnecessary failures.
-rw-r--r--tests/lib/db/connection.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php
index 070c75db55d..720b448d0fb 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();