summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-17 17:29:50 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-12-17 17:29:50 +0100
commit2709244acd6eb385d5c353ff8486470c14670984 (patch)
tree407a153580b3df7523aecbcee3129300ecf41d22
parent8f6a257f1bffd5e27a5aae89eb61fb5553d4670e (diff)
downloadnextcloud-server-2709244acd6eb385d5c353ff8486470c14670984.tar.gz
nextcloud-server-2709244acd6eb385d5c353ff8486470c14670984.zip
Only perform tearDown operations on the database if we have a connection to it .....
-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();