diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 14:20:35 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 14:20:35 +0200 |
commit | b3b080e1c04274fb880ce79c8ee8a8e5d0702989 (patch) | |
tree | 7da865092f0a3c98ab69fdfb8dd1eb7e8f2981ed /tests | |
parent | 1006ec56ceb2c7c5bc14a5401d46767cb4b72e6c (diff) | |
download | nextcloud-server-b3b080e1c04274fb880ce79c8ee8a8e5d0702989.tar.gz nextcloud-server-b3b080e1c04274fb880ce79c8ee8a8e5d0702989.zip |
Strip public webdav info about sharing and mount points
Remove information about whether a file is an incoming share or mount
point when requested over public webdav.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/connector/sabre/filesplugin.php | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/tests/lib/connector/sabre/filesplugin.php b/tests/lib/connector/sabre/filesplugin.php index 54d43d66dda..a4cf9f7bfb9 100644 --- a/tests/lib/connector/sabre/filesplugin.php +++ b/tests/lib/connector/sabre/filesplugin.php @@ -62,7 +62,7 @@ class FilesPlugin extends \Test\TestCase { ->will($this->returnValue('"abc"')); $node->expects($this->any()) ->method('getDavPermissions') - ->will($this->returnValue('R')); + ->will($this->returnValue('DWCKMSR')); return $node; } @@ -98,11 +98,36 @@ class FilesPlugin extends \Test\TestCase { $this->assertEquals('"abc"', $propFind->get(self::GETETAG_PROPERTYNAME)); $this->assertEquals(123, $propFind->get(self::FILEID_PROPERTYNAME)); $this->assertEquals(null, $propFind->get(self::SIZE_PROPERTYNAME)); - $this->assertEquals('R', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); + $this->assertEquals('DWCKMSR', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); $this->assertEquals('http://example.com/', $propFind->get(self::DOWNLOADURL_PROPERTYNAME)); $this->assertEquals(array(self::SIZE_PROPERTYNAME), $propFind->get404Properties()); } + public function testGetPublicPermissions() { + $this->plugin = new \OC\Connector\Sabre\FilesPlugin($this->tree, true); + $this->plugin->initialize($this->server); + + $propFind = new \Sabre\DAV\PropFind( + '/dummyPath', + [ + self::PERMISSIONS_PROPERTYNAME, + ], + 0 + ); + + $node = $this->createTestNode('\OC\Connector\Sabre\File'); + $node->expects($this->any()) + ->method('getDavPermissions') + ->will($this->returnValue('DWCKMSR')); + + $this->plugin->handleGetProperties( + $propFind, + $node + ); + + $this->assertEquals('DWCKR', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); + } + public function testGetPropertiesForDirectory() { $node = $this->createTestNode('\OC\Connector\Sabre\Directory'); @@ -132,7 +157,7 @@ class FilesPlugin extends \Test\TestCase { $this->assertEquals('"abc"', $propFind->get(self::GETETAG_PROPERTYNAME)); $this->assertEquals(123, $propFind->get(self::FILEID_PROPERTYNAME)); $this->assertEquals(1025, $propFind->get(self::SIZE_PROPERTYNAME)); - $this->assertEquals('R', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); + $this->assertEquals('DWCKMSR', $propFind->get(self::PERMISSIONS_PROPERTYNAME)); $this->assertEquals(null, $propFind->get(self::DOWNLOADURL_PROPERTYNAME)); $this->assertEquals(array(self::DOWNLOADURL_PROPERTYNAME), $propFind->get404Properties()); } |