From: Jörn Friedrich Dreyer Date: Thu, 20 Jun 2013 09:41:07 +0000 (+0200) Subject: skip teardown if cache has not been set up X-Git-Tag: v6.0.0alpha2~604^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a7b54c4a215e044e1d984968c0f92c73bec09b7;p=nextcloud-server.git skip teardown if cache has not been set up --- diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index 3dacefa2b80..0e3aaa2d76f 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -151,9 +151,11 @@ class Scanner extends \PHPUnit_Framework_TestCase { } function tearDown() { - $ids = $this->cache->getAll(); - $permissionsCache = $this->storage->getPermissionsCache(); - $permissionsCache->removeMultiple($ids, \OC_User::getUser()); - $this->cache->clear(); + if ($this->cache) { + $ids = $this->cache->getAll(); + $permissionsCache = $this->storage->getPermissionsCache(); + $permissionsCache->removeMultiple($ids, \OC_User::getUser()); + $this->cache->clear(); + } } }