summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-14 14:57:23 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-16 13:17:12 +0200
commit8fa59033acc04a6888d08c68fc3b707d1334d7f2 (patch)
tree211d3083f80e9951c6b4cb9cc72552b6e8c896a1 /tests
parent2ff55560e21874ce4d3c724db20a6ebd86e65221 (diff)
downloadnextcloud-server-8fa59033acc04a6888d08c68fc3b707d1334d7f2.tar.gz
nextcloud-server-8fa59033acc04a6888d08c68fc3b707d1334d7f2.zip
Fix uni tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/connector/sabre/requesttest/downloadtest.php52
-rw-r--r--tests/lib/connector/sabre/requesttest/encryptionuploadtest.php25
2 files changed, 0 insertions, 77 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');
- }
-}
diff --git a/tests/lib/connector/sabre/requesttest/encryptionuploadtest.php b/tests/lib/connector/sabre/requesttest/encryptionuploadtest.php
deleted file mode 100644
index f1849c94760..00000000000
--- a/tests/lib/connector/sabre/requesttest/encryptionuploadtest.php
+++ /dev/null
@@ -1,25 +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 OC\Files\View;
-use Test\Traits\EncryptionTrait;
-
-class EncryptionUploadTest extends UploadTest {
- use EncryptionTrait;
-
- protected function setupUser($name, $password) {
- $this->createUser($name, $password);
- $tmpFolder = \OC::$server->getTempManager()->getTemporaryFolder();
- $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
- $this->setupForUser($name, $password);
- $this->loginWithEncryption($name);
- return new View('/' . $name . '/files');
- }
-}