namespace OC\Files\Storage\Wrapper;
+use OCP\Files\Cache\ICacheEntry;
+
class Quota extends Wrapper {
/**
$cache = $storage->getCache();
}
$data = $cache->get($path);
- if (is_array($data) and isset($data['size'])) {
+ if ($data instanceof ICacheEntry and isset($data['size'])) {
return $data['size'];
} else {
return \OCP\Files\FileInfo::SPACE_NOT_COMPUTED;
namespace Test\Files\Storage\Wrapper;
//ensure the constants are loaded
+use OC\Files\Cache\CacheEntry;
+
\OC::$loader->load('\OC\Files\Filesystem');
/**
$cache->expects($this->once())
->method('get')
->with('files')
- ->will($this->returnValue(array('size' => 50)));
+ ->will($this->returnValue(new CacheEntry(['size' => 50])));
$instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 1024, 'root' => 'files'));