summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-04-09 15:53:09 +0200
committerGitHub <noreply@github.com>2020-04-09 15:53:09 +0200
commitc56a273b39186c509c57ef6bec221d3c4e3d81d3 (patch)
treeb2e4095e763874699646c2c90e41785c99b6f247 /apps/dav/tests/unit/CalDAV
parentf0dd71ccd266ede38114d25be035abb3f2661fc8 (diff)
parentafbd9c4e6ed834e713039f2cff88ba3eec03dadb (diff)
downloadnextcloud-server-c56a273b39186c509c57ef6bec221d3c4e3d81d3.tar.gz
nextcloud-server-c56a273b39186c509c57ef6bec221d3c4e3d81d3.zip
Merge pull request #20383 from nextcloud/techdebt/function-spacing
Unify function spacing to PSR2 recommendation
Diffstat (limited to 'apps/dav/tests/unit/CalDAV')
-rw-r--r--apps/dav/tests/unit/CalDAV/Activity/BackendTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalDavBackendTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarManagerTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php2
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php10
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php6
-rw-r--r--apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php10
-rw-r--r--apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php4
-rw-r--r--apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php6
-rw-r--r--apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php2
15 files changed, 31 insertions, 31 deletions
diff --git a/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php b/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php
index 9e09cda936c..f4179c60665 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/BackendTest.php
@@ -97,7 +97,7 @@ class BackendTest extends TestCase {
$backend = $this->getBackend(['triggerCalendarActivity']);
$backend->expects($this->once())
->method('triggerCalendarActivity')
- ->willReturnCallback(function() use($expectedPayload, $expectedSubject) {
+ ->willReturnCallback(function () use ($expectedPayload, $expectedSubject) {
$arguments = func_get_args();
$this->assertSame($expectedSubject, array_shift($arguments));
$this->assertEquals($expectedPayload, $arguments);
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php b/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php
index 018c0540be3..04ed3a47e05 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Filter/CalendarTest.php
@@ -45,7 +45,7 @@ class CalendarTest extends TestCase {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
- ->willReturnCallback(function($string, $args) {
+ ->willReturnCallback(function ($string, $args) {
return vsprintf($string, $args);
});
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php b/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php
index d013845345d..cc450283d9e 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Filter/TodoTest.php
@@ -44,7 +44,7 @@ class TodoTest extends TestCase {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
- ->willReturnCallback(function($string, $args) {
+ ->willReturnCallback(function ($string, $args) {
return vsprintf($string, $args);
});
diff --git a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
index d2a9cd5e536..eb0ac34c15a 100644
--- a/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
+++ b/apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
@@ -141,7 +141,7 @@ class BaseTest extends TestCase {
$l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
- ->willReturnCallback(function($string, $args) {
+ ->willReturnCallback(function ($string, $args) {
return 't(' . vsprintf($string, $args) . ')';
});
diff --git a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
index 345fd9cbe11..645eaa8b2f8 100644
--- a/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/BirthdayCalendar/EnablePluginTest.php
@@ -129,7 +129,7 @@ class EnablePluginTest extends TestCase {
$this->server->xml->expects($this->once())
->method('parse')
- ->willReturnCallback(function($requestBody, $url, &$documentType) {
+ ->willReturnCallback(function ($requestBody, $url, &$documentType) {
$documentType = '{http://nextcloud.com/ns}disable-birthday-calendar';
});
@@ -167,7 +167,7 @@ class EnablePluginTest extends TestCase {
$this->server->xml->expects($this->once())
->method('parse')
- ->willReturnCallback(function($requestBody, $url, &$documentType) {
+ ->willReturnCallback(function ($requestBody, $url, &$documentType) {
$documentType = '{http://nextcloud.com/ns}enable-birthday-calendar';
});
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
index 761ed734906..8cb6b9fbf10 100644
--- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php
@@ -401,7 +401,7 @@ EOD;
$this->assertArrayHasKey('classification', $card);
}
- usort($calendarObjects, function($a, $b) {
+ usort($calendarObjects, function ($a, $b) {
return $a['id'] - $b['id'];
});
@@ -442,7 +442,7 @@ EOD;
'comp-filters' => $compFilter
]);
- $expectedEventsInResult = array_map(function($index) use($events) {
+ $expectedEventsInResult = array_map(function ($index) use ($events) {
return $events[$index];
}, $expectedEventsInResult);
$this->assertEquals($expectedEventsInResult, $result, '', 0.0, 10, true);
diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
index 94cb169648b..b4095990e50 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php
@@ -70,7 +70,7 @@ class CalendarManagerTest extends \Test\TestCase {
$calendarManager = $this->createMock(Manager::class);
$calendarManager->expects($this->at(0))
->method('registerCalendar')
- ->willReturnCallback(function() {
+ ->willReturnCallback(function () {
$parameter = func_get_arg(0);
$this->assertInstanceOf(CalendarImpl::class, $parameter);
$this->assertEquals(123, $parameter->getKey());
@@ -78,7 +78,7 @@ class CalendarManagerTest extends \Test\TestCase {
$calendarManager->expects($this->at(1))
->method('registerCalendar')
- ->willReturnCallback(function() {
+ ->willReturnCallback(function () {
$parameter = func_get_arg(0);
$this->assertInstanceOf(CalendarImpl::class, $parameter);
$this->assertEquals(456, $parameter->getKey());
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index 80ab0ff5af1..534661af6c6 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -569,7 +569,7 @@ EOD;
$backend->expects($this->any())
->method('getCalendarObject')
- ->willReturnCallback(function($cId, $uri) use($publicObject, $confidentialObject) {
+ ->willReturnCallback(function ($cId, $uri) use ($publicObject, $confidentialObject) {
switch($uri) {
case 'event-0':
return $publicObject;
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php
index 9257fe56e63..69c34d76b09 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProvider/PushProviderTest.php
@@ -80,7 +80,7 @@ class PushProviderTest extends AbstractNotificationProviderTest {
);
}
- public function testNotificationType():void {
+ public function testNotificationType():void {
$this->assertEquals(PushProvider::NOTIFICATION_TYPE, 'DISPLAY');
}
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php
index f0bd91bf002..2900e24119c 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotificationProviderManagerTest.php
@@ -56,7 +56,7 @@ class NotificationProviderManagerTest extends TestCase {
* @throws ProviderNotAvailableException
* @throws NotificationTypeDoesNotExistException
*/
- public function testGetProviderForUnknownType(): void{
+ public function testGetProviderForUnknownType(): void {
$this->expectException(\OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException::class);
$this->expectExceptionMessage('Type NOT EXISTENT is not an accepted type of notification');
@@ -67,19 +67,19 @@ class NotificationProviderManagerTest extends TestCase {
* @throws NotificationTypeDoesNotExistException
* @throws ProviderNotAvailableException
*/
- public function testGetProviderForUnRegisteredType(): void{
+ public function testGetProviderForUnRegisteredType(): void {
$this->expectException(\OCA\DAV\CalDAV\Reminder\NotificationProvider\ProviderNotAvailableException::class);
$this->expectExceptionMessage('No notification provider for type AUDIO available');
$this->providerManager->getProvider('AUDIO');
}
- public function testGetProvider(): void{
+ public function testGetProvider(): void {
$provider = $this->providerManager->getProvider('EMAIL');
$this->assertInstanceOf(EmailProvider::class, $provider);
}
- public function testRegisterProvider(): void{
+ public function testRegisterProvider(): void {
$this->providerManager->registerProvider(PushProvider::class);
$provider = $this->providerManager->getProvider('DISPLAY');
$this->assertInstanceOf(PushProvider::class, $provider);
@@ -88,7 +88,7 @@ class NotificationProviderManagerTest extends TestCase {
/**
* @throws \OCP\AppFramework\QueryException
*/
- public function testRegisterBadProvider(): void{
+ public function testRegisterBadProvider(): void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid notification provider registered');
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
index 38240182275..568a65b77d3 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/NotifierTest.php
@@ -61,18 +61,18 @@ class NotifierTest extends TestCase {
$this->l10n = $this->createMock(IL10N::class);
$this->l10n->expects($this->any())
->method('t')
- ->willReturnCallback(function($string, $args) {
+ ->willReturnCallback(function ($string, $args) {
return vsprintf($string, $args);
});
$this->l10n->expects($this->any())
->method('l')
- ->willReturnCallback(function($string, $args) {
+ ->willReturnCallback(function ($string, $args) {
/** \DateTime $args */
return $args->format(\DateTime::ATOM);
});
$this->l10n->expects($this->any())
->method('n')
- ->willReturnCallback(function($textSingular, $textPlural, $count, $args) {
+ ->willReturnCallback(function ($textSingular, $textPlural, $count, $args) {
$text = $count === 1 ? $textSingular : $textPlural;
$text = str_replace('%n', (string)$count, $text);
return vsprintf($text, $args);
diff --git a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
index 11ecdbc354b..03e953f5c27 100644
--- a/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
+++ b/apps/dav/tests/unit/CalDAV/Reminder/ReminderServiceTest.php
@@ -501,7 +501,7 @@ EOD;
$provider1->expects($this->once())
->method('send')
- ->with($this->callback(function($vevent) {
+ ->with($this->callback(function ($vevent) {
if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') {
return false;
}
@@ -509,7 +509,7 @@ EOD;
}, 'Displayname 123', $user));
$provider2->expects($this->once())
->method('send')
- ->with($this->callback(function($vevent) {
+ ->with($this->callback(function ($vevent) {
if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') {
return false;
}
@@ -517,7 +517,7 @@ EOD;
}, 'Displayname 123', $user));
$provider3->expects($this->once())
->method('send')
- ->with($this->callback(function($vevent) {
+ ->with($this->callback(function ($vevent) {
if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-09T00:00:00+00:00') {
return false;
}
@@ -525,7 +525,7 @@ EOD;
}, 'Displayname 123', $user));
$provider4->expects($this->once())
->method('send')
- ->with($this->callback(function($vevent) {
+ ->with($this->callback(function ($vevent) {
if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-06-30T00:00:00+00:00') {
return false;
}
@@ -533,7 +533,7 @@ EOD;
}, 'Displayname 123', $user));
$provider5->expects($this->once())
->method('send')
- ->with($this->callback(function($vevent) {
+ ->with($this->callback(function ($vevent) {
if ($vevent->DTSTART->getDateTime()->format(\DateTime::ATOM) !== '2016-07-07T00:00:00+00:00') {
return false;
}
diff --git a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
index b2fdc7f0a81..1dbd45ea4ca 100644
--- a/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
+++ b/apps/dav/tests/unit/CalDAV/ResourceBooking/AbstractPrincipalBackendTest.php
@@ -236,7 +236,7 @@ abstract class AbstractPrincipalBackendTest extends TestCase {
$this->proxyMapper->expects($this->at(1))
->method('insert')
- ->with($this->callback(function($proxy) {
+ ->with($this->callback(function ($proxy) {
/** @var Proxy $proxy */
if ($proxy->getOwnerId() !== $this->principalPrefix . '/backend1-res1') {
return false;
@@ -252,7 +252,7 @@ abstract class AbstractPrincipalBackendTest extends TestCase {
}));
$this->proxyMapper->expects($this->at(2))
->method('insert')
- ->with($this->callback(function($proxy) {
+ ->with($this->callback(function ($proxy) {
/** @var Proxy $proxy */
if ($proxy->getOwnerId() !== $this->principalPrefix . '/backend1-res1') {
return false;
diff --git a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
index ebe5beb7275..53e1b8d0c8f 100644
--- a/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
+++ b/apps/dav/tests/unit/CalDAV/Schedule/IMipPluginTest.php
@@ -107,7 +107,7 @@ class IMipPluginTest extends TestCase {
$l10n = $this->createMock(IL10N::class);
$l10n->method('t')
- ->willReturnCallback(function($text, $parameters = []) {
+ ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
});
$l10nFactory = $this->createMock(IFactory::class);
@@ -223,7 +223,7 @@ class IMipPluginTest extends TestCase {
/**
* @dataProvider dataIncludeResponseButtons
*/
- public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons ) {
+ public function testIncludeResponseButtons(string $config_setting, string $recipient, bool $has_buttons) {
$message = $this->_testMessage([],$recipient);
$this->_expectSend($recipient, true, $has_buttons);
@@ -264,7 +264,7 @@ class IMipPluginTest extends TestCase {
$this->assertEquals('1.1', $message->getScheduleStatus());
}
- private function _testMessage(array $attrs = [], string $recipient = 'frodo@hobb.it' ) {
+ private function _testMessage(array $attrs = [], string $recipient = 'frodo@hobb.it') {
$message = new Message();
$message->method = 'REQUEST';
$message->message = new VCalendar();
diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
index c5af8952b99..8de32ad8c35 100644
--- a/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
+++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/RefreshWebcalServiceTest.php
@@ -116,7 +116,7 @@ class RefreshWebcalServiceTest extends TestCase {
$client->expects($this->once())
->method('get')
- ->with('https://foo.bar/bla2', $this->callback(function($obj) {
+ ->with('https://foo.bar/bla2', $this->callback(function ($obj) {
return $obj['allow_redirects']['redirects'] === 10 && $obj['handler'] instanceof HandlerStack;
}))
->willReturn($response);