]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only perform tearDown operations on the database if we have a connection to it .....
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 17 Dec 2015 16:29:50 +0000 (17:29 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 17 Dec 2015 16:29:50 +0000 (17:29 +0100)
tests/lib/testcase.php

index c2a72beffcd1cd97cad75f29de436de294149ca5..1ee0c85b98aec72f625e302bc43d010203813b00 100644 (file)
@@ -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();