|
|
|
@ -99,4 +99,23 @@ class Quota extends \Test\Files\Storage\Storage { |
|
|
|
|
$this->assertEquals('user-space', $meta['wrapper_type']); |
|
|
|
|
fclose($stream); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testSpaceRoot() { |
|
|
|
|
$storage = $this->getMockBuilder('\OC\Files\Storage\Local')->disableOriginalConstructor()->getMock(); |
|
|
|
|
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')->disableOriginalConstructor()->getMock(); |
|
|
|
|
$storage->expects($this->once()) |
|
|
|
|
->method('getCache') |
|
|
|
|
->will($this->returnValue($cache)); |
|
|
|
|
$storage->expects($this->once()) |
|
|
|
|
->method('free_space') |
|
|
|
|
->will($this->returnValue(2048)); |
|
|
|
|
$cache->expects($this->once()) |
|
|
|
|
->method('get') |
|
|
|
|
->with('files') |
|
|
|
|
->will($this->returnValue(array('size' => 50))); |
|
|
|
|
|
|
|
|
|
$instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 1024, 'root' => 'files')); |
|
|
|
|
|
|
|
|
|
$this->assertEquals(1024 - 50, $instance->free_space('')); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|