skip teardown if cache has not been set up

This commit is contained in:
Jörn Friedrich Dreyer 2013-06-20 11:41:07 +02:00
parent c4aa3fac7e
commit 7a7b54c4a2
1 changed files with 6 additions and 4 deletions

View File

@ -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();
}
}
}