Merge pull request #3796 from owncloud/gracefully_handle_teardown_in_scanner_test

skip teardown if cache has not been set up
This commit is contained in:
Thomas Müller 2013-06-20 04:07:33 -07:00
commit 59d3c5a575
1 changed files with 6 additions and 4 deletions

View File

@ -172,9 +172,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();
}
}
}