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;
$this->userFolder->method('get')
->with('/subdir')
->willReturn($node);
-
+
$dummyShares = array_map(function ($type) {
$share = $this->getMockBuilder(IShare::class)->getMock();
$share->expects($this->any())
[[\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]);
+ }
}
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;
];
}
+ 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"