summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-12-23 13:55:51 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-23 13:55:51 +0100
commitddcb42271f569f1f5c5ef71ba7413c57bb13cef3 (patch)
tree25807d3f7766af01e0f50acfc3e87903fb06b9fa
parent5352b4b2b83c5f141f68194c77c239753da30b9e (diff)
parent4569953e5cde340b325a5aa3221bcb2135e1e428 (diff)
downloadnextcloud-server-ddcb42271f569f1f5c5ef71ba7413c57bb13cef3.tar.gz
nextcloud-server-ddcb42271f569f1f5c5ef71ba7413c57bb13cef3.zip
Merge pull request #13008 from owncloud/db-connection-test-cleanup
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();