diff options
author | Robin Appelman <robin@icewind.nl> | 2015-09-21 13:50:35 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2015-09-21 13:50:35 +0200 |
commit | b520a1e5203763adfa354428d2cd924ee7ee86e5 (patch) | |
tree | 2b4bd55789c8fcda22a955bb9883eb54ed2e8c28 /tests | |
parent | 2762f29acf4e3f8ec7a10861dcfa903195d64e4f (diff) | |
parent | 2839ef34395599adf060a485a263a69ce27305e1 (diff) | |
download | nextcloud-server-b520a1e5203763adfa354428d2cd924ee7ee86e5.tar.gz nextcloud-server-b520a1e5203763adfa354428d2cd924ee7ee86e5.zip |
Merge pull request #19081 from owncloud/prevent0bytedownloads
prevent 0 byte downloads when storage returns false
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/connector/sabre/file.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php index e5605dd7cc5..fe4c5ec7c29 100644 --- a/tests/lib/connector/sabre/file.php +++ b/tests/lib/connector/sabre/file.php @@ -809,4 +809,21 @@ class File extends \Test\TestCase { return $files; } + /** + * @expectedException \Sabre\DAV\Exception\ServiceUnavailable + */ + public function testGetFopenFails() { + $view = $this->getMock('\OC\Files\View', ['fopen'], array()); + $view->expects($this->atLeastOnce()) + ->method('fopen') + ->will($this->returnValue(false)); + + $info = new \OC\Files\FileInfo('/test.txt', null, null, array( + 'permissions' => \OCP\Constants::PERMISSION_ALL + ), null); + + $file = new \OC\Connector\Sabre\File($view, $info); + + $file->get(); + } } |