diff options
Diffstat (limited to 'apps/dav/tests/unit')
34 files changed, 64 insertions, 64 deletions
diff --git a/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php b/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php index e4db329393a..b7d907e5ce5 100644 --- a/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php +++ b/apps/dav/tests/unit/BackgroundJob/RegisterRegenerateBirthdayCalendarsTest.php @@ -66,7 +66,7 @@ class RegisterRegenerateBirthdayCalendarsTest extends TestCase { public function testRun() { $this->userManager->expects($this->once()) ->method('callForSeenUsers') - ->willReturnCallback(function($closure) { + ->willReturnCallback(function ($closure) { $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('uid1'); $user2 = $this->createMock(IUser::class); diff --git a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php index 002a3fd94b0..d260ed352e6 100644 --- a/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php +++ b/apps/dav/tests/unit/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJobTest.php @@ -146,7 +146,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res6->method('getBackend')->willReturn($backend3); $res6->method('getAllAvailableMetadataKeys')->willReturn(['meta99', 'meta123']); - $res6->method('getMetadataForKey')->willReturnCallback(function($key) { + $res6->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta99': return 'value99-new'; @@ -165,7 +165,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res7->method('getEMail')->willReturn('res7@foo.bar'); $res7->method('getBackend')->willReturn($backend3); $res7->method('getAllAvailableMetadataKeys')->willReturn(['meta1']); - $res7->method('getMetadataForKey')->willReturnCallback(function($key) { + $res7->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta1': return 'value1'; @@ -181,7 +181,7 @@ class UpdateCalendarResourcesRoomsBackgroundJobTest extends TestCase { $res8->method('getEMail')->willReturn('res8@foo.bar'); $res8->method('getBackend')->willReturn($backend4); $res8->method('getAllAvailableMetadataKeys')->willReturn(['meta2']); - $res8->method('getMetadataForKey')->willReturnCallback(function($key) { + $res8->method('getMetadataForKey')->willReturnCallback(function ($key) { switch($key) { case 'meta2': return 'value2'; 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); diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index aa4f4e8443c..326e77a58be 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -280,7 +280,7 @@ class AddressBookImplTest extends TestCase { // simulate that 'uid0' already exists, so the second uid will be returned $this->backend->expects($this->exactly(2))->method('getContact') ->willReturnCallback( - function($id, $uid) { + function ($id, $uid) { return ($uid === 'uid0.vcf'); } ); diff --git a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php index e132f082556..e6ba0f5ef02 100644 --- a/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php +++ b/apps/dav/tests/unit/CardDAV/BirthdayServiceTest.php @@ -66,7 +66,7 @@ class BirthdayServiceTest extends TestCase { $this->l10n->expects($this->any()) ->method('t') - ->willReturnCallback(function($string, $args) { + ->willReturnCallback(function ($string, $args) { return vsprintf($string, $args); }); @@ -392,7 +392,7 @@ class BirthdayServiceTest extends TestCase { ]; } - public function providesCardChanges(){ + public function providesCardChanges() { return[ ['delete'], ['create'], diff --git a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php index 5efce1c23be..9d23280f607 100644 --- a/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php +++ b/apps/dav/tests/unit/CardDAV/CardDavBackendTest.php @@ -258,7 +258,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::createCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::createCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri && $e->getArgument('cardData') === $this->vcardTest0; @@ -285,7 +285,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::updateCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri && $e->getArgument('cardData') === $this->vcardTest0; @@ -299,7 +299,7 @@ class CardDavBackendTest extends TestCase { // Expect event $this->dispatcher->expects($this->at(0)) ->method('dispatch') - ->with('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $this->callback(function(GenericEvent $e) use ($bookId, $uri) { + ->with('\OCA\DAV\CardDAV\CardDavBackend::deleteCard', $this->callback(function (GenericEvent $e) use ($bookId, $uri) { return $e->getArgument('addressBookId') === $bookId && $e->getArgument('cardUri') === $uri; })); diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index 0f16259d337..4ef1f1bdda1 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -140,7 +140,7 @@ class ImageExportPluginTest extends TestCase { ->willReturn(1); $this->tree->method('getNodeForPath') - ->willReturnCallback(function($path) use ($card, $book) { + ->willReturnCallback(function ($path) use ($card, $book) { if ($path === 'user/book/card') { return $card; } else if ($path === 'user/book') { diff --git a/apps/dav/tests/unit/Comments/RootCollectionTest.php b/apps/dav/tests/unit/Comments/RootCollectionTest.php index 5191c735a67..f039c0d6ea3 100644 --- a/apps/dav/tests/unit/Comments/RootCollectionTest.php +++ b/apps/dav/tests/unit/Comments/RootCollectionTest.php @@ -100,8 +100,8 @@ class RootCollectionTest extends \Test\TestCase { ->method('getUser') ->willReturn($this->user); - $this->dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) { - $event->addEntityCollection('files', function() { + $this->dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function (CommentsEntityEvent $event) { + $event->addEntityCollection('files', function () { return true; }); }); diff --git a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php index 95bab8cad5b..ff9fac3ff18 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ExceptionLoggerPluginTest.php @@ -62,7 +62,7 @@ class ExceptionLoggerPluginTest extends TestCase { $config = $this->createMock(SystemConfig::class); $config->expects($this->any()) ->method('getValue') - ->willReturnCallback(function($key, $default) { + ->willReturnCallback(function ($key, $default) { switch ($key) { case 'loglevel': return 0; diff --git a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php index 870f3709a58..bc49fb442a2 100644 --- a/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/ObjectTreeTest.php @@ -283,7 +283,7 @@ class ObjectTreeTest extends \Test\TestCase { ->getMock(); $view->expects($this->once()) ->method('resolvePath') - ->willReturnCallback(function($path) use ($storage){ + ->willReturnCallback(function ($path) use ($storage) { return [$storage, ltrim($path, '/')]; }); diff --git a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php index cb4104044b7..93cae17d539 100644 --- a/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/PrincipalTest.php @@ -392,7 +392,7 @@ class PrincipalTest 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() !== 'principals/users/foo') { return false; diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index e7a1d5073ed..e83aec4d198 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -125,7 +125,7 @@ class SharesPluginTest extends \Test\TestCase { $this->equalTo(false), $this->equalTo(-1) ) - ->willReturnCallback(function($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes){ + ->willReturnCallback(function ($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes) { if (in_array($requestedShareType, $shareTypes)) { $share = $this->createMock(IShare::class); $share->method('getShareType') @@ -191,7 +191,7 @@ class SharesPluginTest extends \Test\TestCase { ->with('/subdir') ->willReturn($node); - $dummyShares = array_map(function($type) { + $dummyShares = array_map(function ($type) { $share = $this->getMockBuilder(IShare::class)->getMock(); $share->expects($this->any()) ->method('getShareType') @@ -208,7 +208,7 @@ class SharesPluginTest extends \Test\TestCase { $this->equalTo(false), $this->equalTo(-1) ) - ->willReturnCallback(function($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes, $dummyShares){ + ->willReturnCallback(function ($userId, $requestedShareType, $node, $flag, $limit) use ($shareTypes, $dummyShares) { if ($node->getId() === 111 && in_array($requestedShareType, $shareTypes)) { foreach ($dummyShares as $dummyShare) { if ($dummyShare->getShareType() === $requestedShareType) { diff --git a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php index b3b21d2f32a..18f73d9685e 100644 --- a/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php +++ b/apps/dav/tests/unit/Controller/BirthdayCalendarControllerTest.php @@ -82,7 +82,7 @@ class BirthdayCalendarControllerTest extends TestCase { $this->userManager->expects($this->once()) ->method('callForSeenUsers') - ->willReturnCallback(function($closure) { + ->willReturnCallback(function ($closure) { $user1 = $this->createMock(IUser::class); $user1->method('getUID')->willReturn('uid1'); $user2 = $this->createMock(IUser::class); diff --git a/apps/dav/tests/unit/Controller/DirectControllerTest.php b/apps/dav/tests/unit/Controller/DirectControllerTest.php index c24243e81e3..20e5888dfb0 100644 --- a/apps/dav/tests/unit/Controller/DirectControllerTest.php +++ b/apps/dav/tests/unit/Controller/DirectControllerTest.php @@ -143,7 +143,7 @@ class DirectControllerTest extends TestCase { }); $this->urlGenerator->method('getAbsoluteURL') - ->willReturnCallback(function(string $url) { + ->willReturnCallback(function (string $url) { return 'https://my.nextcloud/'.$url; }); diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php index b703ef930e2..6e3a562e801 100644 --- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php +++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php @@ -108,7 +108,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -164,7 +164,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -221,7 +221,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -304,7 +304,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); @@ -382,7 +382,7 @@ EOF; $called = false; $this->responseServer->expects($this->once()) ->method('handleITipMessage') - ->willReturnCallback(function(Message $iTipMessage) use (&$called, $expected) { + ->willReturnCallback(function (Message $iTipMessage) use (&$called, $expected) { $called = true; $this->assertEquals('this-is-the-events-uid', $iTipMessage->uid); $this->assertEquals('VEVENT', $iTipMessage->component); diff --git a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php index 9dcf39d70f3..721c2c4b074 100644 --- a/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php +++ b/apps/dav/tests/unit/DAV/AnonymousOptionsTest.php @@ -37,7 +37,7 @@ class AnonymousOptionsTest extends TestCase { private function sendRequest($method, $path, $userAgent = '') { $server = new Server(); $server->addPlugin(new AnonymousOptionsPlugin()); - $server->addPlugin(new Plugin(new BasicCallBack(function() { + $server->addPlugin(new Plugin(new BasicCallBack(function () { return false; }))); diff --git a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php index ef2634403e5..1143fd8192d 100644 --- a/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php +++ b/apps/dav/tests/unit/Files/Sharing/FilesDropPluginTest.php @@ -124,7 +124,7 @@ class FilesDropPluginTest extends TestCase { ->willReturn('https://example.com'); $this->view->method('file_exists') - ->willReturnCallback(function($path) { + ->willReturnCallback(function ($path) { if ($path === 'file.txt' || $path === '/file.txt') { return true; } else { @@ -165,7 +165,7 @@ class FilesDropPluginTest extends TestCase { ->willReturn('https://example.com'); $this->view->method('file_exists') - ->willReturnCallback(function($path) { + ->willReturnCallback(function ($path) { if ($path === 'file.txt' || $path === '/file.txt') { return true; } else { diff --git a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php index 8d1b36f46cc..1b09c96c940 100644 --- a/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php +++ b/apps/dav/tests/unit/Provisioning/Apple/AppleProvisioningPluginTest.php @@ -78,7 +78,7 @@ class AppleProvisioningPluginTest extends TestCase { $this->themingDefaults, $this->request, $this->l10n, - function() { + function () { return 'generated-uuid'; } ); @@ -92,7 +92,7 @@ class AppleProvisioningPluginTest extends TestCase { $plugin = new AppleProvisioningPlugin($this->userSession, $this->urlGenerator, $this->themingDefaults, $this->request, $this->l10n, - function() {}); + function () {}); $server->expects($this->at(0)) ->method('on') diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php index 58779c0dd46..35a81a03d31 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectMappingCollectionTest.php @@ -251,7 +251,7 @@ class SystemTagsObjectMappingCollectionTest extends \Test\TestCase { $this->tagManager->expects($this->exactly(3)) ->method('canUserSeeTag') - ->willReturnCallback(function($tag) { + ->willReturnCallback(function ($tag) { return $tag->isUserVisible(); }); diff --git a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php index b2af8024084..4e4612001d6 100644 --- a/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php +++ b/apps/dav/tests/unit/SystemTag/SystemTagsObjectTypeCollectionTest.php @@ -84,7 +84,7 @@ class SystemTagsObjectTypeCollectionTest extends \Test\TestCase { ->getMock(); $userFolder = $this->userFolder; - $closure = function($name) use ($userFolder) { + $closure = function ($name) use ($userFolder) { $nodes = $userFolder->getById(intval($name)); return !empty($nodes); }; |