From 2709244acd6eb385d5c353ff8486470c14670984 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 17 Dec 2015 17:29:50 +0100 Subject: Only perform tearDown operations on the database if we have a connection to it ..... --- tests/lib/testcase.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') 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(); -- cgit v1.2.3