From 4569953e5cde340b325a5aa3221bcb2135e1e428 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 23 Dec 2014 01:01:58 +0100 Subject: [PATCH] Clean up test table in Connection Test to prevent unnecessary failures. --- tests/lib/db/connection.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php index 070c75db55..720b448d0f 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();