Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 15:19:56 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 15:19:56 +0300
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/files/tests
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
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/tests')
-rw-r--r--apps/files/tests/Activity/Filter/GenericTest.php1
-rw-r--r--apps/files/tests/Activity/Setting/GenericTest.php1
-rw-r--r--apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php1
-rw-r--r--apps/files/tests/BackgroundJob/ScanFilesTest.php1
-rw-r--r--apps/files/tests/Command/DeleteOrphanedFilesTest.php2
-rw-r--r--apps/files/tests/Controller/ApiControllerTest.php1
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php2
-rw-r--r--apps/files/tests/HelperTest.php1
-rw-r--r--apps/files/tests/Service/TagServiceTest.php6
9 files changed, 5 insertions, 11 deletions
diff --git a/apps/files/tests/Activity/Filter/GenericTest.php b/apps/files/tests/Activity/Filter/GenericTest.php
index 89169a0e85c..eb55ab2699f 100644
--- a/apps/files/tests/Activity/Filter/GenericTest.php
+++ b/apps/files/tests/Activity/Filter/GenericTest.php
@@ -36,7 +36,6 @@ use Test\TestCase;
* @group DB
*/
class GenericTest extends TestCase {
-
public function dataFilters() {
return [
[Favorites::class],
diff --git a/apps/files/tests/Activity/Setting/GenericTest.php b/apps/files/tests/Activity/Setting/GenericTest.php
index 0ebb29d9de3..e741a3e02a8 100644
--- a/apps/files/tests/Activity/Setting/GenericTest.php
+++ b/apps/files/tests/Activity/Setting/GenericTest.php
@@ -34,7 +34,6 @@ use OCP\Activity\ISetting;
use Test\TestCase;
class GenericTest extends TestCase {
-
public function dataSettings() {
return [
[FavoriteAction::class],
diff --git a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
index b7ef5387090..13ccc678b36 100644
--- a/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
+++ b/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php
@@ -257,5 +257,4 @@ class DeleteOrphanedItemsJobTest extends \Test\TestCase {
->execute();
$this->cleanMapping('comments_read_markers');
}
-
}
diff --git a/apps/files/tests/BackgroundJob/ScanFilesTest.php b/apps/files/tests/BackgroundJob/ScanFilesTest.php
index b236f753adb..75557955d6a 100644
--- a/apps/files/tests/BackgroundJob/ScanFilesTest.php
+++ b/apps/files/tests/BackgroundJob/ScanFilesTest.php
@@ -150,5 +150,4 @@ class ScanFilesTest extends TestCase {
$this->invokePrivate($this->scanFiles, 'run', [[]]);
}
-
}
diff --git a/apps/files/tests/Command/DeleteOrphanedFilesTest.php b/apps/files/tests/Command/DeleteOrphanedFilesTest.php
index 8d6098ff18d..e0a8a72aba3 100644
--- a/apps/files/tests/Command/DeleteOrphanedFilesTest.php
+++ b/apps/files/tests/Command/DeleteOrphanedFilesTest.php
@@ -72,7 +72,7 @@ class DeleteOrphanedFilesTest extends TestCase {
protected function tearDown(): void {
$userManager = \OC::$server->getUserManager();
$user1 = $userManager->get($this->user1);
- if($user1) {
+ if ($user1) {
$user1->delete();
}
diff --git a/apps/files/tests/Controller/ApiControllerTest.php b/apps/files/tests/Controller/ApiControllerTest.php
index b35d9d7b95d..d347cffdd81 100644
--- a/apps/files/tests/Controller/ApiControllerTest.php
+++ b/apps/files/tests/Controller/ApiControllerTest.php
@@ -246,5 +246,4 @@ class ApiControllerTest extends TestCase {
$this->assertEquals($expected, $actual);
}
-
}
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index c00f30c890a..50eb40079a0 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -138,7 +138,7 @@ class ViewControllerTest extends TestCase {
[$this->user->getUID(), 'files', 'show_grid', true],
]);
- $this->config
+ $this->config
->expects($this->any())
->method('getAppValue')
->willReturnArgument(2);
diff --git a/apps/files/tests/HelperTest.php b/apps/files/tests/HelperTest.php
index 6b824e8ead8..867d2dab4b0 100644
--- a/apps/files/tests/HelperTest.php
+++ b/apps/files/tests/HelperTest.php
@@ -31,7 +31,6 @@
* Class Helper
*/
class HelperTest extends \Test\TestCase {
-
private function makeFileInfo($name, $size, $mtime, $isDir = false) {
return new \OC\Files\FileInfo(
'/' . $name,
diff --git a/apps/files/tests/Service/TagServiceTest.php b/apps/files/tests/Service/TagServiceTest.php
index 8870c315947..ca6d98909ed 100644
--- a/apps/files/tests/Service/TagServiceTest.php
+++ b/apps/files/tests/Service/TagServiceTest.php
@@ -111,13 +111,14 @@ class TagServiceTest extends \Test\TestCase {
])
->setMethods($methods)
->getMock();
-
}
protected function tearDown(): void {
\OC_User::setUserId('');
$user = \OC::$server->getUserManager()->get($this->user);
- if ($user !== null) { $user->delete(); }
+ if ($user !== null) {
+ $user->delete();
+ }
}
public function testUpdateFileTags() {
@@ -162,7 +163,6 @@ class TagServiceTest extends \Test\TestCase {
}
public function testFavoriteActivity() {
-
$subdir = $this->root->newFolder('subdir');
$file = $subdir->newFile('test.txt');