aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-09-08 12:56:48 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-09-26 11:24:23 +0200
commitb17e836e4586b401864d40e90ecac88f7bdc53ba (patch)
tree1756883d2ee0803c81146e696595e93769f154b5 /apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
parent244de6451b22a1288d3ef698f48fb9c4e78bf15f (diff)
downloadnextcloud-server-b17e836e4586b401864d40e90ecac88f7bdc53ba.tar.gz
nextcloud-server-b17e836e4586b401864d40e90ecac88f7bdc53ba.zip
FilesHome now also returns DAV properties
The files home node must also return DAV properties like etag, permissions, etc for the clients to work like they did with the old endpoint. This fix makes FilesHome extend the Sabre Directory class, this makes the FilesPlugin and other plugins recognize it as a directory and will retrieve the matching properties when applicable. Downstream of https://github.com/owncloud/core/pull/26066 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php52
1 files changed, 0 insertions, 52 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
index e2d63868af0..282a5b2f626 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
@@ -217,58 +217,6 @@ class FilesPluginTest extends TestCase {
$this->assertEquals([self::SIZE_PROPERTYNAME], $propFind->get404Properties());
}
- public function testGetPropertiesForFileHome() {
- /** @var \OCA\DAV\Files\FilesHome | \PHPUnit_Framework_MockObject_MockObject $node */
- $node = $this->getMockBuilder('\OCA\DAV\Files\FilesHome')
- ->disableOriginalConstructor()
- ->getMock();
-
- $propFind = new PropFind(
- '/dummyPath',
- array(
- self::GETETAG_PROPERTYNAME,
- self::FILEID_PROPERTYNAME,
- self::INTERNAL_FILEID_PROPERTYNAME,
- self::SIZE_PROPERTYNAME,
- self::PERMISSIONS_PROPERTYNAME,
- self::DOWNLOADURL_PROPERTYNAME,
- self::OWNER_ID_PROPERTYNAME,
- self::OWNER_DISPLAY_NAME_PROPERTYNAME,
- self::DATA_FINGERPRINT_PROPERTYNAME,
- ),
- 0
- );
-
- $user = $this->getMockBuilder('\OC\User\User')
- ->disableOriginalConstructor()->getMock();
- $user->expects($this->never())->method('getUID');
- $user->expects($this->never())->method('getDisplayName');
-
- $this->plugin->handleGetProperties(
- $propFind,
- $node
- );
-
- $this->assertEquals(null, $propFind->get(self::GETETAG_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::FILEID_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::INTERNAL_FILEID_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::SIZE_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::PERMISSIONS_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::DOWNLOADURL_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::OWNER_ID_PROPERTYNAME));
- $this->assertEquals(null, $propFind->get(self::OWNER_DISPLAY_NAME_PROPERTYNAME));
- $this->assertEquals(['{DAV:}getetag',
- '{http://owncloud.org/ns}id',
- '{http://owncloud.org/ns}fileid',
- '{http://owncloud.org/ns}size',
- '{http://owncloud.org/ns}permissions',
- '{http://owncloud.org/ns}downloadURL',
- '{http://owncloud.org/ns}owner-id',
- '{http://owncloud.org/ns}owner-display-name'
- ], $propFind->get404Properties());
- $this->assertEquals('my_fingerprint', $propFind->get(self::DATA_FINGERPRINT_PROPERTYNAME));
- }
-
public function testGetPropertiesStorageNotAvailable() {
/** @var \OCA\DAV\Connector\Sabre\File | \PHPUnit_Framework_MockObject_MockObject $node */
$node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File');