summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/ApiTest.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/files_sharing/tests/ApiTest.php
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r--apps/files_sharing/tests/ApiTest.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index b8d5a21a739..2d262a0104a 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -53,7 +53,6 @@ use OCP\Share\IShare;
* TODO: convert to real intergration tests
*/
class ApiTest extends TestCase {
-
const TEST_FOLDER_NAME = '/folder_share_api_test';
const APP_NAME = 'files_sharing';
@@ -91,7 +90,7 @@ class ApiTest extends TestCase {
}
protected function tearDown(): void {
- if($this->view instanceof \OC\Files\View) {
+ if ($this->view instanceof \OC\Files\View) {
$this->view->unlink($this->filename);
$this->view->deleteAll($this->folder);
}
@@ -163,7 +162,6 @@ class ApiTest extends TestCase {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
$ocs->deleteShare($data['id']);
$ocs->cleanup();
-
}
@@ -197,7 +195,6 @@ class ApiTest extends TestCase {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1);
$ocs->deleteShare($data['id']);
$ocs->cleanup();
-
}
public function testCreateShareLink() {
@@ -249,7 +246,6 @@ class ApiTest extends TestCase {
}
function testEnforceLinkPassword() {
-
$password = md5(time());
$config = \OC::$server->getConfig();
$config->setAppValue('core', 'shareapi_enforce_links_password', 'yes');
@@ -259,7 +255,6 @@ class ApiTest extends TestCase {
$ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK);
$this->fail();
} catch (OCSForbiddenException $e) {
-
}
$ocs->cleanup();
@@ -268,7 +263,6 @@ class ApiTest extends TestCase {
$ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '');
$this->fail();
} catch (OCSForbiddenException $e) {
-
}
$ocs->cleanup();
@@ -290,7 +284,6 @@ class ApiTest extends TestCase {
$ocs->updateShare($data['id']);
$this->fail();
} catch (OCSBadRequestException $e) {
-
}
$ocs->cleanup();
@@ -933,7 +926,6 @@ class ApiTest extends TestCase {
* @depends testCreateShareLink
*/
function testUpdateShare() {
-
$password = md5(time());
$node1 = $this->userFolder->get($this->filename);
@@ -1054,7 +1046,6 @@ class ApiTest extends TestCase {
$ocs->updateShare($share1->getId());
$this->fail();
} catch (OCSBadRequestException $e) {
-
}
$ocs->cleanup();
@@ -1069,7 +1060,6 @@ class ApiTest extends TestCase {
$ocs->updateShare($share1->getId());
$this->fail();
} catch (OCSBadRequestException $e) {
-
}
$ocs->cleanup();
@@ -1372,7 +1362,7 @@ class ApiTest extends TestCase {
try {
$ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK, null, 'false', '', null, $date->format('Y-m-d'));
$this->fail();
- } catch(OCSException $e) {
+ } catch (OCSException $e) {
$this->assertEquals(404, $e->getCode());
$this->assertEquals('Expiration date is in the past', $e->getMessage());
}