|
|
@@ -109,8 +109,6 @@ class FilesPlugin extends \Test\TestCase { |
|
|
|
return $node; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
*/ |
|
|
|
public function testGetPropertiesForFile() { |
|
|
|
$node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); |
|
|
|
|
|
|
@@ -165,6 +163,56 @@ class FilesPlugin extends \Test\TestCase { |
|
|
|
$this->assertEquals(array(self::SIZE_PROPERTYNAME), $propFind->get404Properties()); |
|
|
|
} |
|
|
|
|
|
|
|
public function testGetPropertiesForFileHome() { |
|
|
|
$node = $this->createTestNode('\OCA\DAV\Files\FilesHome'); |
|
|
|
|
|
|
|
$propFind = new \Sabre\DAV\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 |
|
|
|
), |
|
|
|
0 |
|
|
|
); |
|
|
|
|
|
|
|
$user = $this->getMockBuilder('\OC\User\User') |
|
|
|
->disableOriginalConstructor()->getMock(); |
|
|
|
$user->expects($this->never())->method('getUID'); |
|
|
|
$user->expects($this->never())->method('getDisplayName'); |
|
|
|
$node->expects($this->never())->method('getDirectDownload'); |
|
|
|
$node->expects($this->never())->method('getOwner'); |
|
|
|
$node->expects($this->never())->method('getSize'); |
|
|
|
|
|
|
|
$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()); |
|
|
|
} |
|
|
|
|
|
|
|
public function testGetPropertiesStorageNotAvailable() { |
|
|
|
$node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); |
|
|
|
|