From ad5d04ccbead4ca5f401f588b35639b4c8e44f73 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 8 Feb 2017 16:38:00 +0100 Subject: return unknown free space from nullstorage Signed-off-by: Robin Appelman --- lib/private/Lockdown/Filesystem/NullStorage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/Lockdown/Filesystem/NullStorage.php b/lib/private/Lockdown/Filesystem/NullStorage.php index 967b6d2c6e7..ea911b90064 100644 --- a/lib/private/Lockdown/Filesystem/NullStorage.php +++ b/lib/private/Lockdown/Filesystem/NullStorage.php @@ -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 { @@ -128,7 +129,7 @@ class NullStorage extends Common { } public function free_space($path) { - return 0; + return FileInfo::SPACE_UNKNOWN; } public function touch($path, $mtime = null) { -- cgit v1.2.3 From 5e408aeb6c937980a508d07cce9ed43ff4147c20 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 8 Feb 2017 20:39:34 -0600 Subject: Fix unit tests Signed-off-by: Morris Jobke --- tests/lib/Lockdown/Filesystem/NullStorageTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/lib/Lockdown/Filesystem/NullStorageTest.php b/tests/lib/Lockdown/Filesystem/NullStorageTest.php index dc99eb4c03a..c6faf325cd4 100644 --- a/tests/lib/Lockdown/Filesystem/NullStorageTest.php +++ b/tests/lib/Lockdown/Filesystem/NullStorageTest.php @@ -27,6 +27,7 @@ use Icewind\Streams\IteratorDirectory; use OC\ForbiddenException; use OC\Lockdown\Filesystem\NullCache; use OC\Lockdown\Filesystem\NullStorage; +use OC\Files\FileInfo; use OCP\Files\Storage; use Test\TestCase; @@ -182,7 +183,7 @@ class NullStorageTest extends TestCase { } 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() { -- cgit v1.2.3