diff options
author | Joas Schilling <coding@schilljs.com> | 2023-11-23 10:22:34 +0100 |
---|---|---|
committer | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2023-11-23 10:36:13 +0100 |
commit | aa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch) | |
tree | 843203cd1346158aab3515687e37a90e78c929e9 /apps/user_status/tests | |
parent | 272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff) | |
download | nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip |
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/user_status/tests')
5 files changed, 57 insertions, 59 deletions
diff --git a/apps/user_status/tests/Unit/Connector/UserStatusTest.php b/apps/user_status/tests/Unit/Connector/UserStatusTest.php index 61b5d326287..4a43aede5c0 100644 --- a/apps/user_status/tests/Unit/Connector/UserStatusTest.php +++ b/apps/user_status/tests/Unit/Connector/UserStatusTest.php @@ -26,8 +26,8 @@ declare(strict_types=1); namespace OCA\UserStatus\Tests\Connector; use OCA\UserStatus\Connector\UserStatus; -use Test\TestCase; use OCA\UserStatus\Db; +use Test\TestCase; class UserStatusTest extends TestCase { public function testUserStatus() { diff --git a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php index b0cd9ef501e..cabcc63b291 100644 --- a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php +++ b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php @@ -110,14 +110,14 @@ class UserStatusControllerTest extends TestCase { * @dataProvider setStatusDataProvider */ public function testSetStatus(string $statusType, - ?string $statusIcon, - ?string $message, - ?int $clearAt, - bool $expectSuccess, - bool $expectException, - ?Throwable $exception, - bool $expectLogger, - ?string $expectedLogMessage): void { + ?string $statusIcon, + ?string $message, + ?int $clearAt, + bool $expectSuccess, + bool $expectException, + ?Throwable $exception, + bool $expectLogger, + ?string $expectedLogMessage): void { $userStatus = $this->getUserStatus(); if ($expectException) { @@ -178,12 +178,12 @@ class UserStatusControllerTest extends TestCase { * @dataProvider setPredefinedMessageDataProvider */ public function testSetPredefinedMessage(string $messageId, - ?int $clearAt, - bool $expectSuccess, - bool $expectException, - ?Throwable $exception, - bool $expectLogger, - ?string $expectedLogMessage): void { + ?int $clearAt, + bool $expectSuccess, + bool $expectException, + ?Throwable $exception, + bool $expectLogger, + ?string $expectedLogMessage): void { $userStatus = $this->getUserStatus(); if ($expectException) { @@ -248,14 +248,14 @@ class UserStatusControllerTest extends TestCase { * @dataProvider setCustomMessageDataProvider */ public function testSetCustomMessage(?string $statusIcon, - string $message, - ?int $clearAt, - bool $expectSuccess, - bool $expectException, - ?Throwable $exception, - bool $expectLogger, - ?string $expectedLogMessage, - bool $expectSuccessAsReset = false): void { + string $message, + ?int $clearAt, + bool $expectSuccess, + bool $expectException, + ?Throwable $exception, + bool $expectLogger, + ?string $expectedLogMessage, + bool $expectSuccessAsReset = false): void { $userStatus = $this->getUserStatus(); if ($expectException) { diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php index 38913e5f8f5..58267aed5f4 100644 --- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php +++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php @@ -302,7 +302,7 @@ class UserStatusMapperTest extends TestCase { $this->assertEquals('_user1', $user1Status->getUserId()); $this->assertEquals(true, $user1Status->getIsBackup()); $this->assertEquals('Current', $user1Status->getCustomMessage()); - } else if ($hasBackup) { + } elseif ($hasBackup) { $user1Status = $this->mapper->findByUserId('user1', true); $this->assertEquals('_user1', $user1Status->getUserId()); $this->assertEquals(true, $user1Status->getIsBackup()); diff --git a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php index b2d446d912e..5bc60ca71f9 100644 --- a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php +++ b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php @@ -72,13 +72,13 @@ class UserLiveStatusListenerTest extends TestCase { * @dataProvider handleEventWithCorrectEventDataProvider */ public function testHandleWithCorrectEvent(string $userId, - string $previousStatus, - int $previousTimestamp, - bool $previousIsUserDefined, - string $eventStatus, - int $eventTimestamp, - bool $expectExisting, - bool $expectUpdate): void { + string $previousStatus, + int $previousTimestamp, + bool $previousIsUserDefined, + string $eventStatus, + int $eventTimestamp, + bool $expectExisting, + bool $expectUpdate): void { $userStatus = new UserStatus(); if ($expectExisting) { diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php index d0742a105a3..8789a425622 100644 --- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php +++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php @@ -43,11 +43,9 @@ use OCA\UserStatus\Service\StatusService; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\DB\Exception; -use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IEmojiHelper; use OCP\IUser; -use OCP\IUserBackend; use OCP\IUserManager; use OCP\UserStatus\IUserStatus; use PHPUnit\Framework\MockObject\MockObject; @@ -274,15 +272,15 @@ class StatusServiceTest extends TestCase { * @dataProvider setStatusDataProvider */ public function testSetStatus(string $userId, - string $status, - ?int $statusTimestamp, - bool $isUserDefined, - bool $expectExisting, - bool $expectSuccess, - bool $expectTimeFactory, - bool $expectException, - ?string $expectedExceptionClass, - ?string $expectedExceptionMessage): void { + string $status, + ?int $statusTimestamp, + bool $isUserDefined, + bool $expectExisting, + bool $expectSuccess, + bool $expectTimeFactory, + bool $expectException, + ?string $expectedExceptionClass, + ?string $expectedExceptionMessage): void { $userStatus = new UserStatus(); if ($expectExisting) { @@ -405,14 +403,14 @@ class StatusServiceTest extends TestCase { * @dataProvider setPredefinedMessageDataProvider */ public function testSetPredefinedMessage(string $userId, - string $messageId, - bool $isValidMessageId, - ?int $clearAt, - bool $expectExisting, - bool $expectSuccess, - bool $expectException, - ?string $expectedExceptionClass, - ?string $expectedExceptionMessage): void { + string $messageId, + bool $isValidMessageId, + ?int $clearAt, + bool $expectExisting, + bool $expectSuccess, + bool $expectException, + ?string $expectedExceptionClass, + ?string $expectedExceptionMessage): void { $userStatus = new UserStatus(); if ($expectExisting) { @@ -503,15 +501,15 @@ class StatusServiceTest extends TestCase { * @dataProvider setCustomMessageDataProvider */ public function testSetCustomMessage(string $userId, - ?string $statusIcon, - bool $supportsEmoji, - string $message, - ?int $clearAt, - bool $expectExisting, - bool $expectSuccess, - bool $expectException, - ?string $expectedExceptionClass, - ?string $expectedExceptionMessage): void { + ?string $statusIcon, + bool $supportsEmoji, + string $message, + ?int $clearAt, + bool $expectExisting, + bool $expectSuccess, + bool $expectException, + ?string $expectedExceptionClass, + ?string $expectedExceptionMessage): void { $userStatus = new UserStatus(); if ($expectExisting) { |