|
|
@@ -2,6 +2,8 @@ |
|
|
|
|
|
|
|
namespace OCA\DAV\Tests\Unit\Connector\Sabre; |
|
|
|
|
|
|
|
use OCP\Files\StorageNotAvailableException; |
|
|
|
|
|
|
|
/** |
|
|
|
* Copyright (c) 2015 Vincent Petry <pvince81@owncloud.com> |
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
|
|
@@ -143,6 +145,29 @@ class FilesPlugin extends \Test\TestCase { |
|
|
|
$this->assertEquals(array(self::SIZE_PROPERTYNAME), $propFind->get404Properties()); |
|
|
|
} |
|
|
|
|
|
|
|
public function testGetPropertiesStorageNotAvailable() { |
|
|
|
$node = $this->createTestNode('\OCA\DAV\Connector\Sabre\File'); |
|
|
|
|
|
|
|
$propFind = new \Sabre\DAV\PropFind( |
|
|
|
'/dummyPath', |
|
|
|
array( |
|
|
|
self::DOWNLOADURL_PROPERTYNAME, |
|
|
|
), |
|
|
|
0 |
|
|
|
); |
|
|
|
|
|
|
|
$node->expects($this->once()) |
|
|
|
->method('getDirectDownload') |
|
|
|
->will($this->throwException(new StorageNotAvailableException())); |
|
|
|
|
|
|
|
$this->plugin->handleGetProperties( |
|
|
|
$propFind, |
|
|
|
$node |
|
|
|
); |
|
|
|
|
|
|
|
$this->assertEquals(null, $propFind->get(self::DOWNLOADURL_PROPERTYNAME)); |
|
|
|
} |
|
|
|
|
|
|
|
public function testGetPublicPermissions() { |
|
|
|
$this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view, true); |
|
|
|
$this->plugin->initialize($this->server); |