diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-14 17:06:46 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-14 17:06:46 +0300 |
commit | 7f32cfe6570d112fb748c9a97590e2b9d6e8aafb (patch) | |
tree | 931a9c6eaca5fafcd280f9fe7fa6c268631f60f2 /tests | |
parent | 2107b0f6ffe97ac40152207f7f90cc2a94ce46d1 (diff) |
Update to nextcloud coding standard v0.3.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
102 files changed, 163 insertions, 252 deletions
diff --git a/tests/AddressListTest.php b/tests/AddressListTest.php index 80a783dd4..80d660527 100644 --- a/tests/AddressListTest.php +++ b/tests/AddressListTest.php @@ -32,7 +32,6 @@ use OCA\Mail\Address; use OCA\Mail\AddressList; class AddressListTest extends TestCase { - public function testSerialize() { $list = new AddressList([ new Address('User 1', 'user1@domain.tld'), @@ -182,5 +181,4 @@ class AddressListTest extends TestCase { $this->assertCount(2, $c); } - } diff --git a/tests/AddressTest.php b/tests/AddressTest.php index 7c57446c8..1c7dcb7f6 100644 --- a/tests/AddressTest.php +++ b/tests/AddressTest.php @@ -29,7 +29,6 @@ use Horde_Mail_Rfc822_Address; use OCA\Mail\Address; class AddressTest extends TestCase { - public function testSerialization() { $address = new Address('Christoph Wurst', 'christoph@domain.tld'); @@ -86,5 +85,4 @@ class AddressTest extends TestCase { $this->assertFalse($equals); } - } diff --git a/tests/FolderTest.php b/tests/FolderTest.php index 73d8fe64e..f2c7798ba 100644 --- a/tests/FolderTest.php +++ b/tests/FolderTest.php @@ -149,5 +149,4 @@ class FolderTest extends TestCase { ]; $this->assertEquals($expected, $this->folder->jsonSerialize()); } - } diff --git a/tests/HordeTranslationHandlerTest.php b/tests/HordeTranslationHandlerTest.php index 9bc7cb552..692dce84e 100644 --- a/tests/HordeTranslationHandlerTest.php +++ b/tests/HordeTranslationHandlerTest.php @@ -24,7 +24,6 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\HordeTranslationHandler; class HordeTranslationHandlerTest extends TestCase { - private $handler; protected function setUp(): void { @@ -62,5 +61,4 @@ class HordeTranslationHandlerTest extends TestCase { $this->assertEquals($expected, $actual); } - } diff --git a/tests/Integration/Db/AliasMapperTest.php b/tests/Integration/Db/AliasMapperTest.php index 4cb11acdc..ed79edf1e 100644 --- a/tests/Integration/Db/AliasMapperTest.php +++ b/tests/Integration/Db/AliasMapperTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Tahaa Karim <tahaalibra@gmail.com> @@ -34,7 +36,6 @@ use OCP\IDBConnection; * @group DB */ class AliasMapperTest extends TestCase { - use DatabaseTransaction; /** @var AliasMapper */ @@ -83,17 +84,16 @@ class AliasMapperTest extends TestCase { $this->assertEquals( [ - 'accountId' => $this->alias->getAccountId(), - 'name' => $this->alias->getName(), - 'alias' => $this->alias->getAlias(), - 'id' => $this->alias->getId() + 'accountId' => $this->alias->getAccountId(), + 'name' => $this->alias->getName(), + 'alias' => $this->alias->getAlias(), + 'id' => $this->alias->getId() ], [ - 'accountId' => $result->getAccountId(), - 'name' => $result->getName(), - 'alias' => $result->getAlias(), - 'id' => $result->getId() + 'accountId' => $result->getAccountId(), + 'name' => $result->getName(), + 'alias' => $result->getAlias(), + 'id' => $result->getId() ] ); } - } diff --git a/tests/Integration/Db/CollectedAddressMapperTest.php b/tests/Integration/Db/CollectedAddressMapperTest.php index 810398632..7c04ba628 100644 --- a/tests/Integration/Db/CollectedAddressMapperTest.php +++ b/tests/Integration/Db/CollectedAddressMapperTest.php @@ -33,7 +33,6 @@ use OCP\IDBConnection; * @group DB */ class CollectedAddressMapperTest extends TestCase { - use DatabaseTransaction; /** @var IDBConnection */ @@ -159,5 +158,4 @@ class CollectedAddressMapperTest extends TestCase { $this->assertCount(2, $chunk); } - } diff --git a/tests/Integration/Db/MailAccountMapperTest.php b/tests/Integration/Db/MailAccountMapperTest.php index 8c2a5792a..9dc9b5021 100644 --- a/tests/Integration/Db/MailAccountMapperTest.php +++ b/tests/Integration/Db/MailAccountMapperTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Thomas Müller <thomas.mueller@tmit.eu> @@ -32,7 +34,6 @@ use OCP\IDBConnection; * @group DB */ class MailAccountMapperTest extends TestCase { - use DatabaseTransaction; /** @var MailAccountMapper */ @@ -71,7 +72,7 @@ class MailAccountMapperTest extends TestCase { $this->account->setOrder(27); } - public function testFind(){ + public function testFind() { /** @var MailAccount $b */ $b = $this->mapper->insert($this->account); @@ -79,7 +80,7 @@ class MailAccountMapperTest extends TestCase { $this->assertEquals($b->toJson(), $result->toJson()); $result = $this->mapper->findByUserId($b->getUserId()); - $c = array_filter($result, function($a) use($b){ + $c = array_filter($result, function ($a) use ($b) { /** @var MailAccount $a */ return $a->getId() === $b->getId(); }); diff --git a/tests/Integration/Db/MailAccountTest.php b/tests/Integration/Db/MailAccountTest.php index f208660f7..22b0528c4 100644 --- a/tests/Integration/Db/MailAccountTest.php +++ b/tests/Integration/Db/MailAccountTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Thomas Müller <thomas.mueller@tmit.eu> @@ -25,7 +27,6 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\Db\MailAccount; class MailAccountTest extends TestCase { - public function testToAPI() { $a = new MailAccount(); $a->setId(3); @@ -62,7 +63,7 @@ class MailAccountTest extends TestCase { 'editorMode' => 'html', 'provisioned' => false, 'order' => 13, - ], $a->toJson()); + ], $a->toJson()); } public function testMailAccountConstruct() { @@ -89,5 +90,4 @@ class MailAccountTest extends TestCase { unset($expected['accountName']); $this->assertEquals($expected, $a->toJson()); } - } diff --git a/tests/Integration/Db/MailboxMapperTest.php b/tests/Integration/Db/MailboxMapperTest.php index 0200b0f55..d086d993a 100644 --- a/tests/Integration/Db/MailboxMapperTest.php +++ b/tests/Integration/Db/MailboxMapperTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -34,7 +36,6 @@ use OCP\IDBConnection; use PHPUnit\Framework\MockObject\MockObject; class MailboxMapperTest extends TestCase { - use DatabaseTransaction; /** @var IDBConnection */ @@ -162,5 +163,4 @@ class MailboxMapperTest extends TestCase { $this->assertSame('Trash', $result->getName()); } - } diff --git a/tests/Integration/Framework/ImapTest.php b/tests/Integration/Framework/ImapTest.php index c09eef861..7e9f93cd2 100644 --- a/tests/Integration/Framework/ImapTest.php +++ b/tests/Integration/Framework/ImapTest.php @@ -95,7 +95,7 @@ trait ImapTest { * @return array<string> */ private function listMailboxes(Horde_Imap_Client_Socket $client) { - return array_map(function($mailbox) { + return array_map(function ($mailbox) { return $mailbox['mailbox']; }, $client->listMailboxes('*')); } @@ -145,10 +145,10 @@ trait ImapTest { $data = stream_get_contents($raw); return $client->append($mailbox, [ - [ - 'data' => $data, - ] - ])->ids[0]; + [ + 'data' => $data, + ] + ])->ids[0]; } public function flagMessage($mailbox, $id, MailAccount $account = null) { @@ -252,5 +252,4 @@ trait ImapTest { } return $client; } - } diff --git a/tests/Integration/Framework/ImapTestAccount.php b/tests/Integration/Framework/ImapTestAccount.php index 30271542a..c87db9dbe 100644 --- a/tests/Integration/Framework/ImapTestAccount.php +++ b/tests/Integration/Framework/ImapTestAccount.php @@ -67,5 +67,4 @@ trait ImapTestAccount { return $acc; } - } diff --git a/tests/Integration/Framework/MessageBuilder.php b/tests/Integration/Framework/MessageBuilder.php index 1eeb83062..c22604253 100644 --- a/tests/Integration/Framework/MessageBuilder.php +++ b/tests/Integration/Framework/MessageBuilder.php @@ -117,5 +117,4 @@ class MessageBuilder { public function finish() { return new SimpleMessage($this->from, $this->to, $this->cc, $this->bcc, $this->date, $this->subject, $this->body); } - } diff --git a/tests/Integration/Framework/SelfTest.php b/tests/Integration/Framework/SelfTest.php index 1ab2f1bfb..0b00bf977 100644 --- a/tests/Integration/Framework/SelfTest.php +++ b/tests/Integration/Framework/SelfTest.php @@ -27,7 +27,6 @@ use OCA\Mail\Tests\Integration\TestCase; * Tests the IMAP test framework functionality */ class SelfTest extends TestCase { - use ImapTest; public function testResetAccount() { @@ -51,5 +50,4 @@ class SelfTest extends TestCase { $this->assertMessageCount(1, 'INBOX'); $this->assertIsInt($id); } - } diff --git a/tests/Integration/Framework/SimpleMessage.php b/tests/Integration/Framework/SimpleMessage.php index 8c734867c..c9d55c647 100644 --- a/tests/Integration/Framework/SimpleMessage.php +++ b/tests/Integration/Framework/SimpleMessage.php @@ -66,50 +66,49 @@ class SimpleMessage { /** * @return string */ - function getFrom() { + public function getFrom() { return $this->from; } /** * @return string */ - function getTo() { + public function getTo() { return $this->to; } /** * @return string */ - function getCc() { + public function getCc() { return $this->cc; } /** * @return string */ - function getBcc() { + public function getBcc() { return $this->bcc; } /** * @return string */ - function getDate() { + public function getDate() { return $this->date; } /** * @return string */ - function getSubject() { + public function getSubject() { return $this->subject; } /** * @return string */ - function getBody() { + public function getBody() { return $this->body; } - } diff --git a/tests/Integration/IMAP/AbstractTest.php b/tests/Integration/IMAP/AbstractTest.php index 1aed23c94..334c395a9 100644 --- a/tests/Integration/IMAP/AbstractTest.php +++ b/tests/Integration/IMAP/AbstractTest.php @@ -73,7 +73,6 @@ abstract class AbstractTest extends TestCase { try { self::deleteMailbox($createdMailbox); } catch (Exception $ex) { - } } } @@ -147,5 +146,4 @@ MIME-Version: 1.0 $contents"; $mailbox->saveMessage($message); } - } diff --git a/tests/Integration/IMAP/AccountTest.php b/tests/Integration/IMAP/AccountTest.php index e3779082b..3f8f1c60f 100644 --- a/tests/Integration/IMAP/AccountTest.php +++ b/tests/Integration/IMAP/AccountTest.php @@ -24,7 +24,6 @@ namespace OCA\Mail\Tests\Integration\IMAP; - /** * @group IMAP */ diff --git a/tests/Integration/IMAP/IMAPClientFactoryTest.php b/tests/Integration/IMAP/IMAPClientFactoryTest.php index 675b1ebe9..657ad2462 100644 --- a/tests/Integration/IMAP/IMAPClientFactoryTest.php +++ b/tests/Integration/IMAP/IMAPClientFactoryTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -93,5 +95,4 @@ class IMAPClientFactoryTest extends TestCase { $client = $this->factory->getClient($account); $client->login(); } - } diff --git a/tests/Integration/KItinerary/ItineraryExtractorTest.php b/tests/Integration/KItinerary/ItineraryExtractorTest.php index 16aebe5fa..5849922eb 100644 --- a/tests/Integration/KItinerary/ItineraryExtractorTest.php +++ b/tests/Integration/KItinerary/ItineraryExtractorTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -99,5 +101,4 @@ class ItineraryExtractorTest extends TestCase { $this->assertEquals([], $itinerary->jsonSerialize()); } - } diff --git a/tests/Integration/MailboxSynchronizationTest.php b/tests/Integration/MailboxSynchronizationTest.php index f806479f2..fe54bdab7 100644 --- a/tests/Integration/MailboxSynchronizationTest.php +++ b/tests/Integration/MailboxSynchronizationTest.php @@ -34,7 +34,6 @@ use OCA\Mail\Tests\Integration\Framework\ImapTest; use OCA\Mail\Tests\Integration\Framework\ImapTestAccount; class MailboxSynchronizationTest extends TestCase { - use ImapTest, ImapTestAccount; @@ -181,5 +180,4 @@ class MailboxSynchronizationTest extends TestCase { // $this->assertCount(0, $syncJson['changedMessages']); $this->assertCount(1, $syncJson['vanishedMessages']); } - } diff --git a/tests/Integration/Service/Avatar/FaviconSourceTest.php b/tests/Integration/Service/Avatar/FaviconSourceTest.php index dfbad9f4e..7b0582f9e 100644 --- a/tests/Integration/Service/Avatar/FaviconSourceTest.php +++ b/tests/Integration/Service/Avatar/FaviconSourceTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -84,5 +86,4 @@ class FaviconSourceTest extends TestCase { $this->assertNotNull($avatar); $this->assertEmpty(iterator_to_array($this->getCacheFiles())); } - } diff --git a/tests/Integration/Service/AvatarServiceIntegrationTest.php b/tests/Integration/Service/AvatarServiceIntegrationTest.php index 78e588414..c991584b6 100644 --- a/tests/Integration/Service/AvatarServiceIntegrationTest.php +++ b/tests/Integration/Service/AvatarServiceIntegrationTest.php @@ -73,5 +73,4 @@ class AvatarServiceIntegrationTest extends TestCase { $avatar = $this->service->getAvatar('christoph@winzerhof-wurst.at', 'jan'); $this->assertNull($avatar); // There is none } - } diff --git a/tests/Integration/Service/FolderMapperIntegrationTest.php b/tests/Integration/Service/FolderMapperIntegrationTest.php index 1f8427f49..fd08c6961 100644 --- a/tests/Integration/Service/FolderMapperIntegrationTest.php +++ b/tests/Integration/Service/FolderMapperIntegrationTest.php @@ -63,5 +63,4 @@ class FolderMapperIntegrationTest extends TestCase { $this->assertInstanceOf(Folder::class, $folder); } } - } diff --git a/tests/Integration/Service/MailTransmissionIntegrationTest.php b/tests/Integration/Service/MailTransmissionIntegrationTest.php index 4a9ad10ff..fcfed63f8 100644 --- a/tests/Integration/Service/MailTransmissionIntegrationTest.php +++ b/tests/Integration/Service/MailTransmissionIntegrationTest.php @@ -44,7 +44,6 @@ use OCP\IUser; use OCP\Security\ICrypto; class MailTransmissionIntegrationTest extends TestCase { - use ImapTest, TestUser; @@ -212,5 +211,4 @@ class MailTransmissionIntegrationTest extends TestCase { $this->assertMessageCount(1, 'Drafts'); } - } diff --git a/tests/Integration/TestCase.php b/tests/Integration/TestCase.php index 694f989e1..b8f98234a 100644 --- a/tests/Integration/TestCase.php +++ b/tests/Integration/TestCase.php @@ -25,7 +25,6 @@ use OCA\Mail\Tests\Integration\Framework\ImapTest; use ChristophWurst\Nextcloud\Testing\TestCase as Base; class TestCase extends Base { - protected function setUp(): void { parent::setUp(); @@ -34,5 +33,4 @@ class TestCase extends Base { $this->resetImapAccount(); } } - } diff --git a/tests/Service/ItineraryServiceTest.php b/tests/Service/ItineraryServiceTest.php index 00041c46b..eaa18c751 100644 --- a/tests/Service/ItineraryServiceTest.php +++ b/tests/Service/ItineraryServiceTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -134,5 +136,4 @@ class ItineraryServiceTest extends TestCase { $this->assertEquals(['datafrompdf'], $itinerary->jsonSerialize()); } - } diff --git a/tests/Unit/AppInfo/ApplicationTest.php b/tests/Unit/AppInfo/ApplicationTest.php index eb851449d..a1d51015b 100644 --- a/tests/Unit/AppInfo/ApplicationTest.php +++ b/tests/Unit/AppInfo/ApplicationTest.php @@ -25,12 +25,10 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\AppInfo\Application; class ApplicationTest extends TestCase { - public function testConstrucor() { // Not really a test – it's just about code coverage new Application(); $this->addToAssertionCount(1); } - } diff --git a/tests/Unit/Command/CreateAccountTest.php b/tests/Unit/Command/CreateAccountTest.php index 6ded877e5..317b2fa8a 100644 --- a/tests/Unit/Command/CreateAccountTest.php +++ b/tests/Unit/Command/CreateAccountTest.php @@ -25,7 +25,6 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\Command\CreateAccount; class CreateAccountTest extends TestCase { - private $service; private $crypto; private $command; @@ -72,5 +71,4 @@ class CreateAccountTest extends TestCase { $this->assertTrue(in_array($actArg->getName(), $this->args)); } } - } diff --git a/tests/Unit/Controller/AccountsControllerTest.php b/tests/Unit/Controller/AccountsControllerTest.php index 0d6082a9b..cbb0a816d 100644 --- a/tests/Unit/Controller/AccountsControllerTest.php +++ b/tests/Unit/Controller/AccountsControllerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -121,8 +123,8 @@ class AccountsControllerTest extends TestCase { $this->account->expects($this->once()) ->method('jsonSerialize') ->will($this->returnValue([ - 'accountId' => 123, - ])); + 'accountId' => 123, + ])); $this->accountService->expects($this->once()) ->method('findByUserId') ->with($this->equalTo($this->userId)) @@ -476,5 +478,4 @@ class AccountsControllerTest extends TestCase { $this->assertEquals($expected, $actual); } - } diff --git a/tests/Unit/Controller/AutoconfigControllerTest.php b/tests/Unit/Controller/AutoconfigControllerTest.php index 12e397473..4bd67d293 100644 --- a/tests/Unit/Controller/AutoconfigControllerTest.php +++ b/tests/Unit/Controller/AutoconfigControllerTest.php @@ -26,7 +26,6 @@ use OCA\Mail\Controller\AutoCompleteController; use OCP\AppFramework\Http\JSONResponse; class AutoConfigControllerTest extends TestCase { - private $request; private $service; private $controller; @@ -59,5 +58,4 @@ class AutoConfigControllerTest extends TestCase { $this->assertEquals(new JSONResponse($result), $response); } - } diff --git a/tests/Unit/Controller/AvatarControllerTest.php b/tests/Unit/Controller/AvatarControllerTest.php index 20651c047..557a946cc 100644 --- a/tests/Unit/Controller/AvatarControllerTest.php +++ b/tests/Unit/Controller/AvatarControllerTest.php @@ -58,7 +58,7 @@ class AvatarControllerTest extends TestCase { ->method('getTime') ->willReturn(10000); $this->oldFactory = \OC::$server->offsetGet(ITimeFactory::class); - \OC::$server->registerService(ITimeFactory::class, function() use ($timeFactory) { + \OC::$server->registerService(ITimeFactory::class, function () use ($timeFactory) { return $timeFactory; }); @@ -130,5 +130,4 @@ class AvatarControllerTest extends TestCase { $expected->cacheFor(0); $this->assertEquals($expected, $resp); } - } diff --git a/tests/Unit/Controller/FoldersControllerTest.php b/tests/Unit/Controller/FoldersControllerTest.php index b3a52327e..95e7312ae 100644 --- a/tests/Unit/Controller/FoldersControllerTest.php +++ b/tests/Unit/Controller/FoldersControllerTest.php @@ -160,5 +160,4 @@ class FoldersControllerTest extends TestCase { $this->controller->update(); } - } diff --git a/tests/Unit/Controller/LocalAttachmentsControllerTest.php b/tests/Unit/Controller/LocalAttachmentsControllerTest.php index 41112b143..96b566afb 100644 --- a/tests/Unit/Controller/LocalAttachmentsControllerTest.php +++ b/tests/Unit/Controller/LocalAttachmentsControllerTest.php @@ -84,5 +84,4 @@ class LocalAttachmentsControllerTest extends TestCase { $this->assertEquals(new JSONResponse($attachment, 201), $actual); } - } diff --git a/tests/Unit/Controller/MessagesControllerTest.php b/tests/Unit/Controller/MessagesControllerTest.php index 42acc2725..6c7c5bd69 100644 --- a/tests/Unit/Controller/MessagesControllerTest.php +++ b/tests/Unit/Controller/MessagesControllerTest.php @@ -463,5 +463,4 @@ class MessagesControllerTest extends TestCase { $this->controller->destroy($accountId, $folderId, $messageId); } - } diff --git a/tests/Unit/Controller/PageControllerTest.php b/tests/Unit/Controller/PageControllerTest.php index e52245320..060b9ccb9 100644 --- a/tests/Unit/Controller/PageControllerTest.php +++ b/tests/Unit/Controller/PageControllerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -296,5 +298,4 @@ class PageControllerTest extends TestCase { $this->assertEquals($expected, $response); } - } diff --git a/tests/Unit/Controller/PreferencesControllerTest.php b/tests/Unit/Controller/PreferencesControllerTest.php index d1680ef2e..ec60ffa91 100644 --- a/tests/Unit/Controller/PreferencesControllerTest.php +++ b/tests/Unit/Controller/PreferencesControllerTest.php @@ -73,5 +73,4 @@ class PreferencesControllerTest extends TestCase { $this->assertEquals($expected, $actual); } - } diff --git a/tests/Unit/Controller/ProxyControllerTest.php b/tests/Unit/Controller/ProxyControllerTest.php index e78cb9c95..7f81a6986 100644 --- a/tests/Unit/Controller/ProxyControllerTest.php +++ b/tests/Unit/Controller/ProxyControllerTest.php @@ -192,5 +192,4 @@ class ProxyControllerTest extends TestCase { $this->assertEquals($expected, $response); } - } diff --git a/tests/Unit/Controller/SettingsControllerTest.php b/tests/Unit/Controller/SettingsControllerTest.php index 4e3280c11..0c97f60f7 100644 --- a/tests/Unit/Controller/SettingsControllerTest.php +++ b/tests/Unit/Controller/SettingsControllerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> diff --git a/tests/Unit/Http/AttachmentDownloadResponseTest.php b/tests/Unit/Http/AttachmentDownloadResponseTest.php index 747880bec..11a9d79f9 100644 --- a/tests/Unit/Http/AttachmentDownloadResponseTest.php +++ b/tests/Unit/Http/AttachmentDownloadResponseTest.php @@ -46,8 +46,7 @@ class AttachmentDownloadResponseTest extends TestCase { public function providesResponseData() { return [ - ['1234567890', 'test.txt', 'text/plain'] + ['1234567890', 'test.txt', 'text/plain'] ]; } - } diff --git a/tests/Unit/Http/AvatarDownloadResponseTest.php b/tests/Unit/Http/AvatarDownloadResponseTest.php index 479b0923f..52064ebde 100644 --- a/tests/Unit/Http/AvatarDownloadResponseTest.php +++ b/tests/Unit/Http/AvatarDownloadResponseTest.php @@ -28,12 +28,10 @@ use OCA\Mail\Http\AvatarDownloadResponse; use ChristophWurst\Nextcloud\Testing\TestCase; class AvatarDownloadResponseTest extends TestCase { - public function testResponse() { $response = new AvatarDownloadResponse('data'); $this->assertEquals('application/octet-stream', $response->getHeaders()['Content-Type']); $this->assertEquals('data', $response->render()); } - } diff --git a/tests/Unit/Http/HtmlResponseTest.php b/tests/Unit/Http/HtmlResponseTest.php index 47d528a15..84d025210 100644 --- a/tests/Unit/Http/HtmlResponseTest.php +++ b/tests/Unit/Http/HtmlResponseTest.php @@ -34,15 +34,13 @@ class HtmlResponseTest extends TestCase { * @param $contentType */ public function testIt($content) { - $resp = new HtmlResponse($content); $this->assertEquals($content, $resp->render()); } public function providesResponseData() { return [ - ['1234567890'] + ['1234567890'] ]; } - } diff --git a/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php b/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php index a1cf2c229..d5623421c 100644 --- a/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php @@ -165,5 +165,4 @@ class ErrorMiddlewareTest extends TestCase { $response->getStatus() ); } - } diff --git a/tests/Unit/Http/Middleware/ProvisioningMiddlewareTest.php b/tests/Unit/Http/Middleware/ProvisioningMiddlewareTest.php index 3f42fe201..a894a446e 100644 --- a/tests/Unit/Http/Middleware/ProvisioningMiddlewareTest.php +++ b/tests/Unit/Http/Middleware/ProvisioningMiddlewareTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -207,5 +209,4 @@ class ProvisioningMiddlewareTest extends TestCase { 'index' ); } - } diff --git a/tests/Unit/Http/ProxyDownloadResponseTest.php b/tests/Unit/Http/ProxyDownloadResponseTest.php index 6c993f889..ac9d361b6 100644 --- a/tests/Unit/Http/ProxyDownloadResponseTest.php +++ b/tests/Unit/Http/ProxyDownloadResponseTest.php @@ -46,8 +46,7 @@ class ProxyDownloadResponseTest extends TestCase { public function providesResponseData() { return [ - ['1234567890', 'test.txt', 'text/plain'] + ['1234567890', 'test.txt', 'text/plain'] ]; } - } diff --git a/tests/Unit/IMAP/FolderMapperTest.php b/tests/Unit/IMAP/FolderMapperTest.php index d60460ade..b7d6f0790 100644 --- a/tests/Unit/IMAP/FolderMapperTest.php +++ b/tests/Unit/IMAP/FolderMapperTest.php @@ -53,7 +53,7 @@ class FolderMapperTest extends TestCase { 'delimiter' => true, 'attributes' => true, 'special_use' => true, - ])) + ])) ->willReturn([]); $folders = $this->mapper->getFolders($account, $client); @@ -72,7 +72,7 @@ class FolderMapperTest extends TestCase { 'delimiter' => true, 'attributes' => true, 'special_use' => true, - ])) + ])) ->willReturn([ [ 'mailbox' => new Horde_Imap_Client_Mailbox('INBOX'), @@ -86,7 +86,7 @@ class FolderMapperTest extends TestCase { ], 'delimiter' => '.', ], - ]); + ]); $expected = [ new Folder(27, new Horde_Imap_Client_Mailbox('INBOX'), [], '.'), new Folder(27, new Horde_Imap_Client_Mailbox('Sent'), ['\sent'], '.'), @@ -144,7 +144,7 @@ class FolderMapperTest extends TestCase { 'folder1' => [ 'total' => 123 ], - ]); + ]); $folders[0]->expects($this->once()) ->method('setStatus'); @@ -167,7 +167,7 @@ class FolderMapperTest extends TestCase { ->with($this->equalTo(['folder1'])) ->willReturn([ // Nothing reported for this folder - ]); + ]); $folders[0]->expects($this->never()) ->method('setStatus'); @@ -219,7 +219,7 @@ class FolderMapperTest extends TestCase { ->method('getAttributes') ->willReturn([ Horde_Imap_Client::SPECIALUSE_SENT, - ]); + ]); $folders[0]->expects($this->once()) ->method('addSpecialUse') ->with($this->equalTo('sent')); @@ -252,5 +252,4 @@ class FolderMapperTest extends TestCase { $this->mapper->detectFolderSpecialUse($folders); } - } diff --git a/tests/Unit/IMAP/MailboxSyncTest.php b/tests/Unit/IMAP/MailboxSyncTest.php index dd1ebfb5d..fb8db39ab 100644 --- a/tests/Unit/IMAP/MailboxSyncTest.php +++ b/tests/Unit/IMAP/MailboxSyncTest.php @@ -117,5 +117,4 @@ class MailboxSyncTest extends TestCase { $this->sync->sync($account); } - } diff --git a/tests/Unit/IMAP/MessageMapperTest.php b/tests/Unit/IMAP/MessageMapperTest.php index 548cb2297..666b97219 100644 --- a/tests/Unit/IMAP/MessageMapperTest.php +++ b/tests/Unit/IMAP/MessageMapperTest.php @@ -78,5 +78,4 @@ class MessageMapperTest extends TestCase { $this->assertEquals($expected, $result); } - } diff --git a/tests/Unit/IMAP/Sync/RequestTest.php b/tests/Unit/IMAP/Sync/RequestTest.php index 902ce3a4f..a35da389f 100644 --- a/tests/Unit/IMAP/Sync/RequestTest.php +++ b/tests/Unit/IMAP/Sync/RequestTest.php @@ -51,5 +51,4 @@ class RequestTest extends TestCase { public function testGetSyncToken() { $this->assertEquals($this->syncToken, $this->request->getToken()); } - } diff --git a/tests/Unit/IMAP/Sync/ResponseTest.php b/tests/Unit/IMAP/Sync/ResponseTest.php index 892324abb..27fb3c6b5 100644 --- a/tests/Unit/IMAP/Sync/ResponseTest.php +++ b/tests/Unit/IMAP/Sync/ResponseTest.php @@ -25,7 +25,6 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\IMAP\Sync\Response; class ResponseTest extends TestCase { - public function testJsonSerialize() { $newMessages = []; $changedMessages = []; @@ -41,5 +40,4 @@ class ResponseTest extends TestCase { $this->assertEquals($expected, $json); } - } diff --git a/tests/Unit/IMAP/Sync/SynchronizerTest.php b/tests/Unit/IMAP/Sync/SynchronizerTest.php index 047221e27..ddfaba75f 100644 --- a/tests/Unit/IMAP/Sync/SynchronizerTest.php +++ b/tests/Unit/IMAP/Sync/SynchronizerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -78,5 +80,4 @@ class SynchronizerTest extends TestCase { $this->assertEquals($expected, $response); } - } diff --git a/tests/Unit/Listener/AddressCollectionListenerTest.php b/tests/Unit/Listener/AddressCollectionListenerTest.php index 9d160a144..a9f57f10b 100644 --- a/tests/Unit/Listener/AddressCollectionListenerTest.php +++ b/tests/Unit/Listener/AddressCollectionListenerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -136,5 +138,4 @@ class AddressCollectionListenerTest extends TestCase { $this->addToAssertionCount(1); } - } diff --git a/tests/Unit/Listener/DeleteDraftListenerTest.php b/tests/Unit/Listener/DeleteDraftListenerTest.php index 7b68f26e3..bafe771db 100644 --- a/tests/Unit/Listener/DeleteDraftListenerTest.php +++ b/tests/Unit/Listener/DeleteDraftListenerTest.php @@ -226,5 +226,4 @@ class DeleteDraftListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Listener/DraftMailboxCreatorListenerTest.php b/tests/Unit/Listener/DraftMailboxCreatorListenerTest.php index eb9c69b73..885e6596c 100644 --- a/tests/Unit/Listener/DraftMailboxCreatorListenerTest.php +++ b/tests/Unit/Listener/DraftMailboxCreatorListenerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -146,5 +148,4 @@ class DraftMailboxCreatorListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Listener/FlagRepliedMessageListenerTest.php b/tests/Unit/Listener/FlagRepliedMessageListenerTest.php index d70ad48eb..fae3b3705 100644 --- a/tests/Unit/Listener/FlagRepliedMessageListenerTest.php +++ b/tests/Unit/Listener/FlagRepliedMessageListenerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -187,5 +189,4 @@ class FlagRepliedMessageListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Listener/InteractionListenerTest.php b/tests/Unit/Listener/InteractionListenerTest.php index fa8ccb881..a22d81cea 100644 --- a/tests/Unit/Listener/InteractionListenerTest.php +++ b/tests/Unit/Listener/InteractionListenerTest.php @@ -102,5 +102,4 @@ class InteractionListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Listener/MessageCacheUpdaterListenerTest.php b/tests/Unit/Listener/MessageCacheUpdaterListenerTest.php index 872528b5b..5fac913cf 100644 --- a/tests/Unit/Listener/MessageCacheUpdaterListenerTest.php +++ b/tests/Unit/Listener/MessageCacheUpdaterListenerTest.php @@ -105,5 +105,4 @@ class MessageCacheUpdaterListenerTest extends TestCase { $this->assertTrue($message->getFlagJunk()); } - } diff --git a/tests/Unit/Listener/SaveSentMessageListenerTest.php b/tests/Unit/Listener/SaveSentMessageListenerTest.php index 3850ecb7d..b5a443c03 100644 --- a/tests/Unit/Listener/SaveSentMessageListenerTest.php +++ b/tests/Unit/Listener/SaveSentMessageListenerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -265,5 +267,4 @@ class SaveSentMessageListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Listener/TrashMailboxCreatorListenerTest.php b/tests/Unit/Listener/TrashMailboxCreatorListenerTest.php index 22e86e3b2..4ccc572a8 100644 --- a/tests/Unit/Listener/TrashMailboxCreatorListenerTest.php +++ b/tests/Unit/Listener/TrashMailboxCreatorListenerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -164,5 +166,4 @@ class TrashMailboxCreatorListenerTest extends TestCase { $this->listener->handle($event); } - } diff --git a/tests/Unit/Migration/FixCollectedAddressesTest.php b/tests/Unit/Migration/FixCollectedAddressesTest.php index 0c0ae04d9..40d888b1a 100644 --- a/tests/Unit/Migration/FixCollectedAddressesTest.php +++ b/tests/Unit/Migration/FixCollectedAddressesTest.php @@ -62,14 +62,14 @@ class FixCollectedAddressesTest extends TestCase { $this->mapper->expects($this->exactly(2)) ->method('getChunk') ->will($this->returnValueMap([ - [ - null, [ - $address1, - $address2, - ]], - [ - 201, []] - ])); + [ + null, [ + $address1, + $address2, + ]], + [ + 201, []] + ])); $this->mapper->expects($this->never()) ->method('update'); @@ -89,14 +89,14 @@ class FixCollectedAddressesTest extends TestCase { $this->mapper->expects($this->exactly(2)) ->method('getChunk') ->will($this->returnValueMap([ - [ - null, [ - $address1, - $address2, - ]], - [ - 201, []] - ])); + [ + null, [ + $address1, + $address2, + ]], + [ + 201, []] + ])); $this->mapper->expects($this->once()) ->method('update') ->with($address1); @@ -120,19 +120,18 @@ class FixCollectedAddressesTest extends TestCase { $this->mapper->expects($this->exactly(2)) ->method('getChunk') ->will($this->returnValueMap([ - [ - null, [ - $address1, - $address2, - ]], - [ - 201, []] - ])); + [ + null, [ + $address1, + $address2, + ]], + [ + 201, []] + ])); $this->mapper->expects($this->once()) ->method('delete') ->with($address1); $this->repairStep->run($this->output); } - } diff --git a/tests/Unit/Migration/MigrateProvisioningConfigTest.php b/tests/Unit/Migration/MigrateProvisioningConfigTest.php index b75d1bc06..7a0dc7862 100644 --- a/tests/Unit/Migration/MigrateProvisioningConfigTest.php +++ b/tests/Unit/Migration/MigrateProvisioningConfigTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -102,5 +104,4 @@ class MigrateProvisioningConfigTest extends TestCase { $this->assertEquals('Migrate Mail provisioning config from config.php to the database', $name); } - } diff --git a/tests/Unit/Model/IMAPMessageTest.php b/tests/Unit/Model/IMAPMessageTest.php index cce7ed917..02d2144f7 100644 --- a/tests/Unit/Model/IMAPMessageTest.php +++ b/tests/Unit/Model/IMAPMessageTest.php @@ -31,7 +31,6 @@ use OCA\Mail\Model\IMAPMessage; use OCA\Mail\Service\Html; class IMAPMessageTest extends TestCase { - public function testNoFrom() { $data = new Horde_Imap_Client_Data_Fetch(); $m = new IMAPMessage(null, 'INBOX', 123, $data); @@ -56,8 +55,8 @@ class IMAPMessageTest extends TestCase { $urlGenerator->expects($this->any()) ->method('linkToRoute') ->will($this->returnCallback(function ($url) { - return "https://docs.example.com/server/go.php?to=$url"; - })); + return "https://docs.example.com/server/go.php?to=$url"; + })); $htmlService = new Html($urlGenerator, $request); // mock first fetch @@ -91,5 +90,4 @@ class IMAPMessageTest extends TestCase { $this->assertEquals(1234, $json['id']); } - } diff --git a/tests/Unit/Model/MessageTest.php b/tests/Unit/Model/MessageTest.php index 675831903..1845b5c1e 100644 --- a/tests/Unit/Model/MessageTest.php +++ b/tests/Unit/Model/MessageTest.php @@ -28,7 +28,6 @@ use OCA\Mail\AddressList; use OCA\Mail\Model\Message; class MessageTest extends TestCase { - protected $message; protected function setUp(): void { @@ -166,5 +165,4 @@ class MessageTest extends TestCase { $this->assertCount(1, $actual); //$this->assertEquals($expected, $actual[0]); } - } diff --git a/tests/Unit/Model/NewMessageDataTest.php b/tests/Unit/Model/NewMessageDataTest.php index 9aeadcfa5..55eb50941 100644 --- a/tests/Unit/Model/NewMessageDataTest.php +++ b/tests/Unit/Model/NewMessageDataTest.php @@ -27,7 +27,6 @@ use OCA\Mail\AddressList; use OCA\Mail\Model\NewMessageData; class NewMessageDataTest extends TestCase { - public function testConstructionFromSimpleRequestData() { $account = $this->createMock(Account::class); $to = '"Test" <test@domain.com>'; @@ -68,5 +67,4 @@ class NewMessageDataTest extends TestCase { $this->assertEquals('Hi!', $messageData->getBody()); $this->assertEquals([], $messageData->getAttachments()); } - } diff --git a/tests/Unit/Model/RepliedMessageTest.php b/tests/Unit/Model/RepliedMessageTest.php index 2a59c0ec5..00cbe8bff 100644 --- a/tests/Unit/Model/RepliedMessageTest.php +++ b/tests/Unit/Model/RepliedMessageTest.php @@ -27,7 +27,6 @@ use OCA\Mail\Model\RepliedMessageData; use PHPUnit\Framework\MockObject\MockObject; class RepliedMessageTest extends TestCase { - public function testGetAccount() { /** @var Account|MockObject $account */ $account = $this->createMock(Account::class); @@ -53,5 +52,4 @@ class RepliedMessageTest extends TestCase { $this->assertEquals($messageId, $data->getId()); } - } diff --git a/tests/Unit/SMTP/SmtpClientFactoryTest.php b/tests/Unit/SMTP/SmtpClientFactoryTest.php index d0c14bb1f..bcf076848 100644 --- a/tests/Unit/SMTP/SmtpClientFactoryTest.php +++ b/tests/Unit/SMTP/SmtpClientFactoryTest.php @@ -123,5 +123,4 @@ class SmtpClientFactoryTest extends TestCase { $this->assertInstanceOf(Horde_Mail_Transport_Smtphorde::class, $transport); $this->assertEquals($expected, $transport); } - } diff --git a/tests/Unit/Service/AccountServiceTest.php b/tests/Unit/Service/AccountServiceTest.php index 9289b70c5..a129ca8d2 100644 --- a/tests/Unit/Service/AccountServiceTest.php +++ b/tests/Unit/Service/AccountServiceTest.php @@ -156,5 +156,4 @@ class AccountServiceTest extends TestCase { $this->accountService->updateSignature($id, $uid, $signature); } - } diff --git a/tests/Unit/Service/AliasesServiceTest.php b/tests/Unit/Service/AliasesServiceTest.php index 5da2a7344..98e8064e1 100644 --- a/tests/Unit/Service/AliasesServiceTest.php +++ b/tests/Unit/Service/AliasesServiceTest.php @@ -95,15 +95,15 @@ class AliasesServiceTest extends TestCase { $this->assertEquals( [ - 'accountId' => $aliasEntity->getAccountId(), - 'name' => $aliasEntity->getName(), - 'alias' => $aliasEntity->getAlias(), - 'id' => $aliasEntity->getId() + 'accountId' => $aliasEntity->getAccountId(), + 'name' => $aliasEntity->getName(), + 'alias' => $aliasEntity->getAlias(), + 'id' => $aliasEntity->getId() ], [ - 'accountId' => $result->getAccountId(), - 'name' => $result->getName(), - 'alias' => $result->getAlias(), - 'id' => $result->getId() + 'accountId' => $result->getAccountId(), + 'name' => $result->getName(), + 'alias' => $result->getAlias(), + 'id' => $result->getId() ] ); } @@ -120,5 +120,4 @@ class AliasesServiceTest extends TestCase { $this->service->delete($aliasId, $this->user); } - } diff --git a/tests/Unit/Service/Attachment/AttachmentServiceTest.php b/tests/Unit/Service/Attachment/AttachmentServiceTest.php index deff97cb8..fc0381826 100644 --- a/tests/Unit/Service/Attachment/AttachmentServiceTest.php +++ b/tests/Unit/Service/Attachment/AttachmentServiceTest.php @@ -57,13 +57,13 @@ class AttachmentServiceTest extends TestCase { ->method('getFileName') ->willReturn('cat.jpg'); $attachment = LocalAttachment::fromParams([ - 'userId' => $userId, - 'fileName' => 'cat.jpg', + 'userId' => $userId, + 'fileName' => 'cat.jpg', ]); $persistedAttachment = LocalAttachment::fromParams([ - 'id' => 123, - 'userId' => $userId, - 'fileName' => 'cat.jpg', + 'id' => 123, + 'userId' => $userId, + 'fileName' => 'cat.jpg', ]); $this->mapper->expects($this->once()) ->method('insert') @@ -88,13 +88,13 @@ class AttachmentServiceTest extends TestCase { ->method('getFileName') ->willReturn('cat.jpg'); $attachment = LocalAttachment::fromParams([ - 'userId' => $userId, - 'fileName' => 'cat.jpg', + 'userId' => $userId, + 'fileName' => 'cat.jpg', ]); $persistedAttachment = LocalAttachment::fromParams([ - 'id' => 123, - 'userId' => $userId, - 'fileName' => 'cat.jpg', + 'id' => 123, + 'userId' => $userId, + 'fileName' => 'cat.jpg', ]); $this->mapper->expects($this->once()) ->method('insert') @@ -106,5 +106,4 @@ class AttachmentServiceTest extends TestCase { $this->service->addFile($userId, $uploadedFile); } - } diff --git a/tests/Unit/Service/Attachment/AttachmentStorageTest.php b/tests/Unit/Service/Attachment/AttachmentStorageTest.php index 95089590b..fde5e3298 100644 --- a/tests/Unit/Service/Attachment/AttachmentStorageTest.php +++ b/tests/Unit/Service/Attachment/AttachmentStorageTest.php @@ -33,7 +33,6 @@ use OCP\Files\SimpleFS\ISimpleFolder; use PHPUnit_Framework_MockObject_MockObject; class AttachmentStorageTest extends TestCase { - private $tmpFilePath = '/tmp/nc_mail_attachment_test'; /** @var IAppData|PHPUnit_Framework_MockObject_MockObject */ @@ -168,5 +167,4 @@ class AttachmentStorageTest extends TestCase { $this->storage->save('fritz', 123, $uploadedFile); } - } diff --git a/tests/Unit/Service/Attachment/UploadedFileTest.php b/tests/Unit/Service/Attachment/UploadedFileTest.php index b4b3e51da..ab36ae6cb 100644 --- a/tests/Unit/Service/Attachment/UploadedFileTest.php +++ b/tests/Unit/Service/Attachment/UploadedFileTest.php @@ -25,7 +25,6 @@ use ChristophWurst\Nextcloud\Testing\TestCase; use OCA\Mail\Service\Attachment\UploadedFile; class UploadedFileTest extends TestCase { - public function testGetFileNameNotExisting() { $file = new UploadedFile([]); @@ -53,5 +52,4 @@ class UploadedFileTest extends TestCase { $this->assertEquals('/tmp/path', $file->getTempPath()); } - } diff --git a/tests/Unit/Service/Autocompletion/AddressCollectorTest.php b/tests/Unit/Service/Autocompletion/AddressCollectorTest.php index 0b387896b..23e6424b0 100644 --- a/tests/Unit/Service/Autocompletion/AddressCollectorTest.php +++ b/tests/Unit/Service/Autocompletion/AddressCollectorTest.php @@ -28,7 +28,6 @@ use OCA\Mail\Service\AutoCompletion\AddressCollector; use OCP\ILogger; class AddressCollectorTest extends TestCase { - private $mapper; private $userId = 'testuser'; private $logger; @@ -109,5 +108,4 @@ class AddressCollectorTest extends TestCase { $this->assertequals($mapperResult, $result); } - } diff --git a/tests/Unit/Service/Autocompletion/AutoCompleteServiceTest.php b/tests/Unit/Service/Autocompletion/AutoCompleteServiceTest.php index 9bd24bec7..dd431a295 100644 --- a/tests/Unit/Service/Autocompletion/AutoCompleteServiceTest.php +++ b/tests/Unit/Service/Autocompletion/AutoCompleteServiceTest.php @@ -30,7 +30,6 @@ use OCA\Mail\Service\ContactsIntegration; use OCA\Mail\Service\GroupsIntegration; class AutoCompleteServiceTest extends TestCase { - private $contactsIntegration; private $groupsIntegration; private $addressCollector; @@ -91,5 +90,4 @@ class AutoCompleteServiceTest extends TestCase { ]; $this->assertEquals($expected, $response); } - } diff --git a/tests/Unit/Service/Autoconfig/AutoConfigTest.php b/tests/Unit/Service/Autoconfig/AutoConfigTest.php index fe58d7013..23d087592 100644 --- a/tests/Unit/Service/Autoconfig/AutoConfigTest.php +++ b/tests/Unit/Service/Autoconfig/AutoConfigTest.php @@ -95,5 +95,4 @@ class AutoConfigTest extends TestCase { $this->assertSame($account, $result); } - } diff --git a/tests/Unit/Service/Autoconfig/ConfigurationDetectorTest.php b/tests/Unit/Service/Autoconfig/ConfigurationDetectorTest.php index dcc92a433..423461cbd 100644 --- a/tests/Unit/Service/Autoconfig/ConfigurationDetectorTest.php +++ b/tests/Unit/Service/Autoconfig/ConfigurationDetectorTest.php @@ -78,5 +78,4 @@ class ConfigurationDetectorTest extends TestCase { $this->assertNotNull($result); } - } diff --git a/tests/Unit/Service/Autoconfig/ConnectivityTesterTest.php b/tests/Unit/Service/Autoconfig/ConnectivityTesterTest.php index d7f636fc6..99c6a19f4 100644 --- a/tests/Unit/Service/Autoconfig/ConnectivityTesterTest.php +++ b/tests/Unit/Service/Autoconfig/ConnectivityTesterTest.php @@ -65,5 +65,4 @@ class ConnectivityTesterTest extends TestCase { $this->assertFalse($canConnect); $this->assertLessThan(15, $after - $before); } - } diff --git a/tests/Unit/Service/Autoconfig/ImapConnectivityTesterTest.php b/tests/Unit/Service/Autoconfig/ImapConnectivityTesterTest.php index 6b1350513..9ef26961a 100644 --- a/tests/Unit/Service/Autoconfig/ImapConnectivityTesterTest.php +++ b/tests/Unit/Service/Autoconfig/ImapConnectivityTesterTest.php @@ -71,5 +71,4 @@ class ImapConnectivityTesterTest extends TestCase { $this->assertNull($result); } - } diff --git a/tests/Unit/Service/Autoconfig/ImapConnectorTest.php b/tests/Unit/Service/Autoconfig/ImapConnectorTest.php index 889917126..514fc3263 100644 --- a/tests/Unit/Service/Autoconfig/ImapConnectorTest.php +++ b/tests/Unit/Service/Autoconfig/ImapConnectorTest.php @@ -91,5 +91,4 @@ class ImapConnectorTest extends TestCase { $this->fail('should not have been reached'); } - } diff --git a/tests/Unit/Service/Autoconfig/ImapServerDetectorTest.php b/tests/Unit/Service/Autoconfig/ImapServerDetectorTest.php index 28d98b483..364812228 100644 --- a/tests/Unit/Service/Autoconfig/ImapServerDetectorTest.php +++ b/tests/Unit/Service/Autoconfig/ImapServerDetectorTest.php @@ -103,5 +103,4 @@ class ImapServerDetectorTest extends TestCase { $this->assertNull($account); } - } diff --git a/tests/Unit/Service/Autoconfig/IspDbTest.php b/tests/Unit/Service/Autoconfig/IspDbTest.php index 9e765948c..2d3abc495 100644 --- a/tests/Unit/Service/Autoconfig/IspDbTest.php +++ b/tests/Unit/Service/Autoconfig/IspDbTest.php @@ -27,7 +27,6 @@ use OCA\Mail\Service\AutoConfig\IspDb; use OCP\ILogger; class IspDbtest extends TestCase { - private $logger; protected function setUp(): void { @@ -104,5 +103,4 @@ class IspDbtest extends TestCase { $this->assertArrayHasKey('smtp', $data); $this->assertTrue(count($data['smtp']) >= 1, 'no isp smtp data returned'); } - } diff --git a/tests/Unit/Service/Autoconfig/MxRecordTest.php b/tests/Unit/Service/Autoconfig/MxRecordTest.php index 560ffdb73..c6c449843 100644 --- a/tests/Unit/Service/Autoconfig/MxRecordTest.php +++ b/tests/Unit/Service/Autoconfig/MxRecordTest.php @@ -49,5 +49,4 @@ class MxRecordTest extends TestCase { $this->assertFalse($records); } - } diff --git a/tests/Unit/Service/Autoconfig/SmtpConnectivityTesterTest.php b/tests/Unit/Service/Autoconfig/SmtpConnectivityTesterTest.php index d82b99a55..311c96b32 100644 --- a/tests/Unit/Service/Autoconfig/SmtpConnectivityTesterTest.php +++ b/tests/Unit/Service/Autoconfig/SmtpConnectivityTesterTest.php @@ -79,5 +79,4 @@ class SmtpConnectivityTesterTest extends TestCase { $this->assertFalse($result); } - } diff --git a/tests/Unit/Service/Autoconfig/SmtpServerDetectorTest.php b/tests/Unit/Service/Autoconfig/SmtpServerDetectorTest.php index 3179c6e14..fee8949d1 100644 --- a/tests/Unit/Service/Autoconfig/SmtpServerDetectorTest.php +++ b/tests/Unit/Service/Autoconfig/SmtpServerDetectorTest.php @@ -101,5 +101,4 @@ class SmtpServerDetectorTest extends TestCase { $this->assertFalse($result); } - } diff --git a/tests/Unit/Service/Avatar/AddressbookSourceTest.php b/tests/Unit/Service/Avatar/AddressbookSourceTest.php index c20958afb..1bee35d37 100644 --- a/tests/Unit/Service/Avatar/AddressbookSourceTest.php +++ b/tests/Unit/Service/Avatar/AddressbookSourceTest.php @@ -75,5 +75,4 @@ class AddressbookSourceTest extends TestCase { $this->assertNull($avatar); } - } diff --git a/tests/Unit/Service/Avatar/CacheTest.php b/tests/Unit/Service/Avatar/CacheTest.php index 36b76c121..f43c6e374 100644 --- a/tests/Unit/Service/Avatar/CacheTest.php +++ b/tests/Unit/Service/Avatar/CacheTest.php @@ -33,8 +33,7 @@ use OCP\ICacheFactory; use PHPUnit_Framework_MockObject_MockObject; class CacheTest extends TestCase { - - const BLACK_DOT_BASE64 = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='; + public const BLACK_DOT_BASE64 = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='; /** @var ICacheFactory|PHPUnit_Framework_MockObject_MockObject */ private $cacheFactory; @@ -135,5 +134,4 @@ class CacheTest extends TestCase { $this->cache->addImage('https://doe.com/favicon.ico', $uid, self::BLACK_DOT_BASE64); } - } diff --git a/tests/Unit/Service/Avatar/CompositeAvatarSourceTest.php b/tests/Unit/Service/Avatar/CompositeAvatarSourceTest.php index c4573537a..ba78c099b 100644 --- a/tests/Unit/Service/Avatar/CompositeAvatarSourceTest.php +++ b/tests/Unit/Service/Avatar/CompositeAvatarSourceTest.php @@ -134,5 +134,4 @@ class CompositeAvatarSourceTest extends TestCase { $this->assertEquals($avatar, $actualAvatar); } - } diff --git a/tests/Unit/Service/Avatar/DownloaderTest.php b/tests/Unit/Service/Avatar/DownloaderTest.php index be669eedd..40fa2a9c3 100644 --- a/tests/Unit/Service/Avatar/DownloaderTest.php +++ b/tests/Unit/Service/Avatar/DownloaderTest.php @@ -81,5 +81,4 @@ class DownloaderTest extends TestCase { $this->assertNull($data); } - } diff --git a/tests/Unit/Service/Avatar/FaviconSourceTest.php b/tests/Unit/Service/Avatar/FaviconSourceTest.php index 7bc21c971..e73ec3736 100644 --- a/tests/Unit/Service/Avatar/FaviconSourceTest.php +++ b/tests/Unit/Service/Avatar/FaviconSourceTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2017 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -132,5 +134,4 @@ class FaviconSourceTest extends TestCase { $this->assertNull($avatar); } - } diff --git a/tests/Unit/Service/Avatar/GravatarSouceTest.php b/tests/Unit/Service/Avatar/GravatarSouceTest.php index ced023b4d..fc43f4ec3 100644 --- a/tests/Unit/Service/Avatar/GravatarSouceTest.php +++ b/tests/Unit/Service/Avatar/GravatarSouceTest.php @@ -92,5 +92,4 @@ class GravatarSourceTest extends TestCase { $this->assertNull($actualAvatar); } - } diff --git a/tests/Unit/Service/AvatarServiceTest.php b/tests/Unit/Service/AvatarServiceTest.php index 83144dd0e..f7be67dba 100644 --- a/tests/Unit/Service/AvatarServiceTest.php +++ b/tests/Unit/Service/AvatarServiceTest.php @@ -37,8 +37,7 @@ use OCP\IURLGenerator; use PHPUnit_Framework_MockObject_MockObject; class AvatarServiceTest extends TestCase { - - const BLACK_DOT_BASE64 = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='; + public const BLACK_DOT_BASE64 = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='; /** @var IAvatarSource|PHPUnit_Framework_MockObject_MockObject */ private $source; @@ -262,5 +261,4 @@ class AvatarServiceTest extends TestCase { $this->assertNull($image); } - } diff --git a/tests/Unit/Service/ContactsIntegrationTest.php b/tests/Unit/Service/ContactsIntegrationTest.php index 1041d8c21..f60036d83 100644 --- a/tests/Unit/Service/ContactsIntegrationTest.php +++ b/tests/Unit/Service/ContactsIntegrationTest.php @@ -213,5 +213,4 @@ class ContactsIntegrationTest extends TestCase { $this->assertEquals($actual, $actual); } - } diff --git a/tests/Unit/Service/Group/ContactsGroupServiceTest.php b/tests/Unit/Service/Group/ContactsGroupServiceTest.php index 7d5894d23..38097646f 100644 --- a/tests/Unit/Service/Group/ContactsGroupServiceTest.php +++ b/tests/Unit/Service/Group/ContactsGroupServiceTest.php @@ -1,7 +1,7 @@ <?php /** -* @author Boris Fritscher <boris.fritscher@gmail.com> + * @author Boris Fritscher <boris.fritscher@gmail.com> * * Mail * @@ -175,7 +175,4 @@ class ContactsGroupServiceTest extends TestCase { $this->assertEquals($expected, $actual); } - - } - diff --git a/tests/Unit/Service/Group/NextcloudGroupServiceTest.php b/tests/Unit/Service/Group/NextcloudGroupServiceTest.php index 43df1f067..dac3fdb7d 100644 --- a/tests/Unit/Service/Group/NextcloudGroupServiceTest.php +++ b/tests/Unit/Service/Group/NextcloudGroupServiceTest.php @@ -29,7 +29,6 @@ use OCP\IGroup; use OCP\IUser; class NextcloudGroupServiceTest extends TestCase { - private $groupsManager; private $groupService; @@ -129,7 +128,6 @@ class NextcloudGroupServiceTest extends TestCase { ]; $this->assertEquals($expected, $actual); - } public function testGetUsersWrong() { @@ -141,6 +139,4 @@ class NextcloudGroupServiceTest extends TestCase { $this->groupService->getUsers('nogroup'); } - } - diff --git a/tests/Unit/Service/GroupsIntegrationTest.php b/tests/Unit/Service/GroupsIntegrationTest.php index 758c93846..273f17b13 100644 --- a/tests/Unit/Service/GroupsIntegrationTest.php +++ b/tests/Unit/Service/GroupsIntegrationTest.php @@ -97,7 +97,6 @@ class GroupsIntegrationTest extends TestCase { $actual = $this->groupsIntegration->expand($recipients); $this->assertEquals($expected, $actual); - } public function testExpand() { @@ -123,7 +122,6 @@ class GroupsIntegrationTest extends TestCase { $actual = $this->groupsIntegration->expand($recipients); $this->assertEquals($expected, $actual); - } public function testExpand2() { @@ -149,7 +147,6 @@ class GroupsIntegrationTest extends TestCase { $actual = $this->groupsIntegration->expand($recipients); $this->assertEquals($expected, $actual); - } public function testExpandUmlauts() { @@ -221,7 +218,6 @@ class GroupsIntegrationTest extends TestCase { $actual = $this->groupsIntegration->expand($recipients); $this->assertEquals($expected, $actual); - } public function testExpandWrong2() { @@ -229,7 +225,5 @@ class GroupsIntegrationTest extends TestCase { $recipients = "john@doe.com,namespace1:nogroup,alice@smith.net"; $this->groupsIntegration->expand($recipients); - } - } diff --git a/tests/Unit/Service/HtmlTest.php b/tests/Unit/Service/HtmlTest.php index 054811b95..a42ff8ee4 100644 --- a/tests/Unit/Service/HtmlTest.php +++ b/tests/Unit/Service/HtmlTest.php @@ -80,10 +80,9 @@ class HtmlTest extends TestCase { public function parseMailBodyProvider() { return [ - ['abc', null, 'abc'], - ['abc', 'def', "abc-- \r\ndef"], - ["abc-- \r\ndef", 'ghi', "abc-- \r\ndef-- \r\nghi"], + ['abc', null, 'abc'], + ['abc', 'def', "abc-- \r\ndef"], + ["abc-- \r\ndef", 'ghi', "abc-- \r\ndef-- \r\nghi"], ]; } - } diff --git a/tests/Unit/Service/MailManagerTest.php b/tests/Unit/Service/MailManagerTest.php index 0570a34cf..de2385e16 100644 --- a/tests/Unit/Service/MailManagerTest.php +++ b/tests/Unit/Service/MailManagerTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -322,5 +324,4 @@ class MailManagerTest extends TestCase { $this->manager->flagMessage($account, 'INBOX', 123, 'seen', false); } - } diff --git a/tests/Unit/Service/MailTransmissionTest.php b/tests/Unit/Service/MailTransmissionTest.php index c7489e9ab..b50f32930 100644 --- a/tests/Unit/Service/MailTransmissionTest.php +++ b/tests/Unit/Service/MailTransmissionTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> @@ -247,5 +249,4 @@ class MailTransmissionTest extends TestCase { $this->assertEquals(13, $newId); } - } diff --git a/tests/Unit/Service/Provisioning/ConfigMapperTest.php b/tests/Unit/Service/Provisioning/ConfigMapperTest.php index 45e9090cd..c311cb810 100644 --- a/tests/Unit/Service/Provisioning/ConfigMapperTest.php +++ b/tests/Unit/Service/Provisioning/ConfigMapperTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -81,5 +83,4 @@ class ConfigMapperTest extends TestCase { $this->assertInstanceOf(Config::class, $config); } - } diff --git a/tests/Unit/Service/Provisioning/ConfigTest.php b/tests/Unit/Service/Provisioning/ConfigTest.php index 064843780..b5222be64 100644 --- a/tests/Unit/Service/Provisioning/ConfigTest.php +++ b/tests/Unit/Service/Provisioning/ConfigTest.php @@ -26,7 +26,6 @@ use OCA\Mail\Service\Provisioning\Config; use OCP\IUser; class ConfigTest extends TestCase { - public function testBuildEmailWithUserId() { $user = $this->createMock(IUser::class); $config = new Config([ @@ -194,5 +193,4 @@ class ConfigTest extends TestCase { $this->assertEquals('user@domain.se', $config->buildImapUser($user)); } - } diff --git a/tests/Unit/Service/Provisioning/TestConfig.php b/tests/Unit/Service/Provisioning/TestConfig.php index 66357a724..26cf72bdc 100644 --- a/tests/Unit/Service/Provisioning/TestConfig.php +++ b/tests/Unit/Service/Provisioning/TestConfig.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -26,7 +28,6 @@ namespace OCA\mail\tests\Unit\Service\Provisioning; use OCA\Mail\Service\Provisioning\Config; class TestConfig extends Config { - public function __construct() { parent::__construct([ 'email' => '%USERID%@domain.com', @@ -40,5 +41,4 @@ class TestConfig extends Config { 'smtpSslMode' => 'tls', ]); } - } diff --git a/tests/Unit/Service/Search/MailSearchTest.php b/tests/Unit/Service/Search/MailSearchTest.php index 230dad903..3168fe040 100644 --- a/tests/Unit/Service/Search/MailSearchTest.php +++ b/tests/Unit/Service/Search/MailSearchTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at> @@ -222,5 +224,4 @@ class MailSearchTest extends TestCase { $this->assertCount(2, $messages); } - } diff --git a/tests/Unit/Service/SetupServiceTest.php b/tests/Unit/Service/SetupServiceTest.php index dce28ac37..8655d4632 100644 --- a/tests/Unit/Service/SetupServiceTest.php +++ b/tests/Unit/Service/SetupServiceTest.php @@ -101,5 +101,4 @@ class SetupServiceTest extends TestCase { $this->assertEquals($expected, $actual); } - } diff --git a/tests/Unit/Service/UserPreferenceServiceTest.php b/tests/Unit/Service/UserPreferenceServiceTest.php index 7c13070b3..1b1d6434b 100644 --- a/tests/Unit/Service/UserPreferenceServiceTest.php +++ b/tests/Unit/Service/UserPreferenceServiceTest.php @@ -66,5 +66,4 @@ class UserPreferenceServiceTest extends TestCase { $this->service->setPreference('test', '123'); } - } diff --git a/tests/Unit/Settings/AdminSettingsTest.php b/tests/Unit/Settings/AdminSettingsTest.php index c2e038e6c..7cdfca83a 100644 --- a/tests/Unit/Settings/AdminSettingsTest.php +++ b/tests/Unit/Settings/AdminSettingsTest.php @@ -1,4 +1,6 @@ -<?php declare(strict_types=1); +<?php + +declare(strict_types=1); /** * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> |