skip teardown if cache has not been set up

remotes/origin/stable6
Jörn Friedrich Dreyer 13 years ago
parent c4aa3fac7e
commit 7a7b54c4a2
  1. 10
      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();
}
}
}

Loading…
Cancel
Save