aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2020-04-21 14:00:52 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2020-04-21 14:00:52 +0200
commit0e925285b7d261983e79be51c7019dbb501252f5 (patch)
treed1d15046d7c062d7508933c7fa8031ba67b0474a /apps
parent8730cc6764d6e6c030602088835e473268d3a384 (diff)
downloadnextcloud-server-0e925285b7d261983e79be51c7019dbb501252f5.tar.gz
nextcloud-server-0e925285b7d261983e79be51c7019dbb501252f5.zip
Add test that shares and tags are ignored for chunk files.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php23
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php21
2 files changed, 43 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
index 153bc0cd93b..9144068a6cb 100644
--- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php
@@ -32,6 +32,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\File;
use OCA\DAV\Connector\Sabre\Node;
+use OCA\DAV\Upload\UploadFile;
use OCP\Files\Folder;
use OCP\IUser;
use OCP\IUserSession;
@@ -189,7 +190,7 @@ class SharesPluginTest extends \Test\TestCase {
$this->userFolder->method('get')
->with('/subdir')
->willReturn($node);
-
+
$dummyShares = array_map(function ($type) {
$share = $this->getMockBuilder(IShare::class)->getMock();
$share->expects($this->any())
@@ -282,4 +283,24 @@ class SharesPluginTest extends \Test\TestCase {
[[\OCP\Share::SHARE_TYPE_USER, \OCP\Share::SHARE_TYPE_REMOTE]],
];
}
+
+ public function testGetPropertiesSkipChunks(): void {
+ $sabreNode = $this->getMockBuilder(UploadFile::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $propFind = new \Sabre\DAV\PropFind(
+ '/dummyPath',
+ [self::SHARETYPES_PROPERTYNAME],
+ 0
+ );
+
+ $this->plugin->handleGetProperties(
+ $propFind,
+ $sabreNode
+ );
+
+ $result = $propFind->getResultForMultiStatus();
+ $this->assertCount(1, $result[404]);
+ }
}
diff --git a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
index 210e732438c..95e567961d1 100644
--- a/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/TagsPluginTest.php
@@ -30,6 +30,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\File;
use OCA\DAV\Connector\Sabre\Node;
+use OCA\DAV\Upload\UploadFile;
use OCP\ITagManager;
use OCP\ITags;
use Sabre\DAV\Tree;
@@ -266,6 +267,26 @@ class TagsPluginTest extends \Test\TestCase {
];
}
+ public function testGetPropertiesSkipChunks(): void {
+ $sabreNode = $this->getMockBuilder(UploadFile::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $propFind = new \Sabre\DAV\PropFind(
+ '/dummyPath',
+ [self::TAGS_PROPERTYNAME, self::TAG_FAVORITE],
+ 0
+ );
+
+ $this->plugin->handleGetProperties(
+ $propFind,
+ $sabreNode
+ );
+
+ $result = $propFind->getResultForMultiStatus();
+ $this->assertCount(2, $result[404]);
+ }
+
public function testUpdateTags() {
// this test will replace the existing tags "tagremove" with "tag1" and "tag2"
// and keep "tagkeep"