summaryrefslogtreecommitdiffstats
path: root/tests/lib/testcase.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/testcase.php')
-rw-r--r--tests/lib/testcase.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php
index c2a72beffcd..1ee0c85b98a 100644
--- a/tests/lib/testcase.php
+++ b/tests/lib/testcase.php
@@ -156,11 +156,13 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
$dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest');
- $queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+ if (\OC::$server->getDatabaseConnection()) {
+ $queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
- self::tearDownAfterClassCleanShares($queryBuilder);
- self::tearDownAfterClassCleanStorages($queryBuilder);
- self::tearDownAfterClassCleanFileCache($queryBuilder);
+ self::tearDownAfterClassCleanShares($queryBuilder);
+ self::tearDownAfterClassCleanStorages($queryBuilder);
+ self::tearDownAfterClassCleanFileCache($queryBuilder);
+ }
self::tearDownAfterClassCleanStrayDataFiles($dataDir);
self::tearDownAfterClassCleanStrayHooks();
self::tearDownAfterClassCleanStrayLocks();