Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11] return unknown free space from nullstorage #3508

Merged
merged 2 commits into from Feb 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/private/Lockdown/Filesystem/NullStorage.php
Expand Up @@ -20,6 +20,7 @@
namespace OC\Lockdown\Filesystem;

use Icewind\Streams\IteratorDirectory;
use OC\Files\FileInfo;
use OC\Files\Storage\Common;

class NullStorage extends Common {
Expand Down Expand Up @@ -128,7 +129,7 @@ public function hash($type, $path, $raw = false) {
}

public function free_space($path) {
return 0;
return FileInfo::SPACE_UNKNOWN;
}

public function touch($path, $mtime = null) {
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/Lockdown/Filesystem/NullStorageTest.php
Expand Up @@ -27,6 +27,7 @@
use OC\ForbiddenException;
use OC\Lockdown\Filesystem\NullCache;
use OC\Lockdown\Filesystem\NullStorage;
use OC\Files\FileInfo;
use OCP\Files\Storage;
use Test\TestCase;

Expand Down Expand Up @@ -182,7 +183,7 @@ public function testHash() {
}

public function testFree_space() {
$this->assertSame(0, $this->storage->free_space('foo'));
$this->assertSame(FileInfo::SPACE_UNKNOWN, $this->storage->free_space('foo'));
}

public function testTouch() {
Expand Down