summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/BackgroundJob
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/dav/tests/unit/BackgroundJob
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/dav/tests/unit/BackgroundJob')
-rw-r--r--apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php4
-rw-r--r--apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php10
2 files changed, 6 insertions, 8 deletions
diff --git a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
index 0704bf1e9d6..b19c78d83c4 100644
--- a/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/EventReminderJobTest.php
@@ -53,8 +53,7 @@ class EventReminderJobTest extends TestCase {
$this->backgroundJob = new EventReminderJob($this->reminderService, $this->config);
}
- public function data(): array
- {
+ public function data(): array {
return [
[true, true, true],
[true, false, false],
@@ -81,7 +80,6 @@ class EventReminderJobTest extends TestCase {
->method('getAppValue')
->with('dav', 'sendEventRemindersMode', 'backgroundjob')
->willReturn($sendEventRemindersMode ? 'backgroundjob' : 'cron');
-
}
if ($expectCall) {
diff --git a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
index d260ed352e6..cc960b4e5d2 100644
--- a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
+++ b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php
@@ -147,7 +147,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res6->method('getAllAvailableMetadataKeys')->willReturn(['meta99', 'meta123']);
$res6->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta99':
return 'value99-new';
@@ -166,7 +166,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res7->method('getBackend')->willReturn($backend3);
$res7->method('getAllAvailableMetadataKeys')->willReturn(['meta1']);
$res7->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta1':
return 'value1';
@@ -182,7 +182,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$res8->method('getBackend')->willReturn($backend4);
$res8->method('getAllAvailableMetadataKeys')->willReturn(['meta2']);
$res8->method('getMetadataForKey')->willReturnCallback(function ($key) {
- switch($key) {
+ switch ($key) {
case 'meta2':
return 'value2';
@@ -218,7 +218,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$rows = [];
$ids = [];
$stmt = $query->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$ids[$row['backend_id'] . '::' . $row['resource_id']] = $row['id'];
unset($row['id']);
$rows[] = $row;
@@ -288,7 +288,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase {
$rows2 = [];
$stmt = $query2->execute();
- while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
+ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
unset($row['id']);
$rows2[] = $row;
}