diff options
Diffstat (limited to 'tests/lib/connector/sabre/requesttest/downloadtest.php')
-rw-r--r-- | tests/lib/connector/sabre/requesttest/downloadtest.php | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/lib/connector/sabre/requesttest/downloadtest.php b/tests/lib/connector/sabre/requesttest/downloadtest.php deleted file mode 100644 index 67dd9f52308..00000000000 --- a/tests/lib/connector/sabre/requesttest/downloadtest.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php -/** - * Copyright (c) 2015 Robin Appelman <icewind@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace Test\Connector\Sabre\RequestTest; - -use OCP\AppFramework\Http; -use OCP\Lock\ILockingProvider; - -class DownloadTest extends RequestTest { - public function testDownload() { - $user = $this->getUniqueID(); - $view = $this->setupUser($user, 'pass'); - - $view->file_put_contents('foo.txt', 'bar'); - - $response = $this->request($view, $user, 'pass', 'GET', '/foo.txt'); - $this->assertEquals(Http::STATUS_OK, $response->getStatus()); - $this->assertEquals(stream_get_contents($response->getBody()), 'bar'); - } - - /** - * @expectedException \OC\Connector\Sabre\Exception\FileLocked - */ - public function testDownloadWriteLocked() { - $user = $this->getUniqueID(); - $view = $this->setupUser($user, 'pass'); - - $view->file_put_contents('foo.txt', 'bar'); - - $view->lockFile('/foo.txt', ILockingProvider::LOCK_EXCLUSIVE); - - $this->request($view, $user, 'pass', 'GET', '/foo.txt', 'asd'); - } - - public function testDownloadReadLocked() { - $user = $this->getUniqueID(); - $view = $this->setupUser($user, 'pass'); - - $view->file_put_contents('foo.txt', 'bar'); - - $view->lockFile('/foo.txt', ILockingProvider::LOCK_SHARED); - - $response = $this->request($view, $user, 'pass', 'GET', '/foo.txt', 'asd'); - $this->assertEquals(Http::STATUS_OK, $response->getStatus()); - $this->assertEquals(stream_get_contents($response->getBody()), 'bar'); - } -} |