diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-04-30 10:13:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 10:13:19 +0300 |
commit | b8b53a2d9a1cd12d112116151d32ff400f518524 (patch) | |
tree | b4694731090828eca9c325a3d324dc55b40f37e3 /apps/dav/tests | |
parent | a1f3293c06648f6b3c36353edb4a04794fabbba9 (diff) | |
parent | 902d12555e0e4347cef82da0a6bc9283f7394cd0 (diff) |
Merge pull request #19436 from nextcloud/bugfix/noid/dav-quota-calculation
Do not include mountpoints when calculating quota usage on WebDAV
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index d3d17eefec1..69b2dd5877e 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -98,7 +98,7 @@ class DirectoryTest extends \Test\TestCase { return new Directory($this->view, $this->info); } - + public function testDeleteRootFolderFails() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -111,7 +111,7 @@ class DirectoryTest extends \Test\TestCase { $dir->delete(); } - + public function testDeleteForbidden() { $this->expectException(\OCA\DAV\Connector\Sabre\Exception\Forbidden::class); @@ -130,7 +130,7 @@ class DirectoryTest extends \Test\TestCase { $dir->delete(); } - + public function testDeleteFolderWhenAllowed() { // deletion allowed $this->info->expects($this->once()) @@ -147,7 +147,7 @@ class DirectoryTest extends \Test\TestCase { $dir->delete(); } - + public function testDeleteFolderFailsWhenNotAllowed() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -159,7 +159,7 @@ class DirectoryTest extends \Test\TestCase { $dir->delete(); } - + public function testDeleteFolderThrowsWhenDeletionFailed() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -217,7 +217,7 @@ class DirectoryTest extends \Test\TestCase { $dir->getChildren(); } - + public function testGetChildrenNoPermission() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); @@ -230,7 +230,7 @@ class DirectoryTest extends \Test\TestCase { $dir->getChildren(); } - + public function testGetChildNoPermission() { $this->expectException(\Sabre\DAV\Exception\NotFound::class); @@ -242,7 +242,7 @@ class DirectoryTest extends \Test\TestCase { $dir->getChild('test'); } - + public function testGetChildThrowStorageNotAvailableException() { $this->expectException(\Sabre\DAV\Exception\ServiceUnavailable::class); @@ -254,7 +254,7 @@ class DirectoryTest extends \Test\TestCase { $dir->getChild('.'); } - + public function testGetChildThrowInvalidPath() { $this->expectException(\OCA\DAV\Connector\Sabre\Exception\InvalidPath::class); @@ -295,6 +295,10 @@ class DirectoryTest extends \Test\TestCase { ->method('getStorage') ->willReturn($storage); + $this->view->expects($this->once()) + ->method('getFileInfo') + ->willReturn($this->info); + $dir = new Directory($this->view, $this->info); $this->assertEquals([200, -3], $dir->getQuotaInfo()); //200 used, unlimited } @@ -327,6 +331,10 @@ class DirectoryTest extends \Test\TestCase { ->method('getStorage') ->willReturn($storage); + $this->view->expects($this->once()) + ->method('getFileInfo') + ->willReturn($this->info); + $dir = new Directory($this->view, $this->info); $this->assertEquals([200, 800], $dir->getQuotaInfo()); //200 used, 800 free } @@ -404,7 +412,7 @@ class DirectoryTest extends \Test\TestCase { $this->assertTrue($targetNode->moveInto(basename($destination), $source, $sourceNode)); } - + public function testFailingMove() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); $this->expectExceptionMessage('Could not copy directory b, target exists'); |