From 524333a78518acd4b7980dc6f4e7d675cbf39a90 Mon Sep 17 00:00:00 2001 From: mattamon Date: Mon, 4 Mar 2024 11:27:34 +0000 Subject: [PATCH] Apply php-cs-fixer changes --- tests/Unit/Dto/Token/CreateTest.php | 2 +- tests/Unit/Dto/Token/InfoTest.php | 2 +- tests/Unit/Dto/Token/OutputTest.php | 4 ++-- tests/Unit/Dto/Token/RefreshTest.php | 2 +- .../Service/Security/SecurityServiceTest.php | 24 +++++++++---------- .../Unit/State/Token/Create/ProcessorTest.php | 3 +-- .../State/Token/Refresh/ProcessorTest.php | 3 +-- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/tests/Unit/Dto/Token/CreateTest.php b/tests/Unit/Dto/Token/CreateTest.php index 1bdddb478..9399a04a9 100644 --- a/tests/Unit/Dto/Token/CreateTest.php +++ b/tests/Unit/Dto/Token/CreateTest.php @@ -24,4 +24,4 @@ public function testTokenCreate(): void $this->assertSame('token', $create->getUsername()); $this->assertSame('test', $create->getPassword()); } -} \ No newline at end of file +} diff --git a/tests/Unit/Dto/Token/InfoTest.php b/tests/Unit/Dto/Token/InfoTest.php index d0dd3e32e..f0a3315dc 100644 --- a/tests/Unit/Dto/Token/InfoTest.php +++ b/tests/Unit/Dto/Token/InfoTest.php @@ -24,4 +24,4 @@ public function testTokenInfo(): void $this->assertSame('token', $info->getToken()); $this->assertSame('test', $info->getUsername()); } -} \ No newline at end of file +} diff --git a/tests/Unit/Dto/Token/OutputTest.php b/tests/Unit/Dto/Token/OutputTest.php index f55bb8005..020035950 100644 --- a/tests/Unit/Dto/Token/OutputTest.php +++ b/tests/Unit/Dto/Token/OutputTest.php @@ -20,9 +20,9 @@ final class OutputTest extends Unit { public function testTokenOutput(): void { - $output = new Output('token',3600, 'test'); + $output = new Output('token', 3600, 'test'); $this->assertSame('token', $output->getToken()); $this->assertSame(3600, $output->getLifetime()); $this->assertSame('test', $output->getUsername()); } -} \ No newline at end of file +} diff --git a/tests/Unit/Dto/Token/RefreshTest.php b/tests/Unit/Dto/Token/RefreshTest.php index 7513100d9..7633e11c1 100644 --- a/tests/Unit/Dto/Token/RefreshTest.php +++ b/tests/Unit/Dto/Token/RefreshTest.php @@ -23,4 +23,4 @@ public function testTokenRefresh(): void $refresh = new Refresh('token'); $this->assertSame('token', $refresh->getToken()); } -} \ No newline at end of file +} diff --git a/tests/Unit/Service/Security/SecurityServiceTest.php b/tests/Unit/Service/Security/SecurityServiceTest.php index ca120c3ff..00bcb09a4 100644 --- a/tests/Unit/Service/Security/SecurityServiceTest.php +++ b/tests/Unit/Service/Security/SecurityServiceTest.php @@ -25,7 +25,6 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Security\Core\Exception\UserNotFoundException; - final class SecurityServiceTest extends Unit { /** @@ -43,7 +42,6 @@ public function testSecurityService(): void /** * @throws Exception */ - public function testInvalidPassword(): void { $securityService = $this->mockSecurityService(false); @@ -52,7 +50,6 @@ public function testInvalidPassword(): void $securityService->authenticateUser(new Create('test', 'test')); } - /** * @throws Exception */ @@ -102,11 +99,11 @@ private function mockSecurityService($validPassword = true, bool $withUser = tru private function mockUserProviderWithUser(): UserProvider { return $this->makeEmpty(UserProvider::class, [ - 'loadUserByIdentifier' => function() { + 'loadUserByIdentifier' => function () { return $this->makeEmpty(User::class, [ - 'getPassword' => 'test' + 'getPassword' => 'test', ]); - } + }, ]); } @@ -116,7 +113,7 @@ private function mockUserProviderWithUser(): UserProvider private function mockUserProviderWithOutUser(): UserProvider { return $this->makeEmpty(UserProvider::class, [ - 'loadUserByIdentifier' => fn() => throw new UserNotFoundException('User not found') + 'loadUserByIdentifier' => fn () => throw new UserNotFoundException('User not found'), ]); } @@ -126,7 +123,7 @@ private function mockUserProviderWithOutUser(): UserProvider private function mockPasswordHasher($validPassword = true): UserPasswordHasherInterface { return $this->makeEmpty(UserPasswordHasherInterface::class, [ - 'isPasswordValid' => $validPassword + 'isPasswordValid' => $validPassword, ]); } @@ -136,14 +133,15 @@ private function mockPasswordHasher($validPassword = true): UserPasswordHasherIn private function mockTmpStoreResolver($withTmpStore = true): TmpStoreResolverInterface { return $this->makeEmpty(TmpStoreResolverInterface::class, [ - 'get' => $withTmpStore ? $this->mockTmpStore(): null + 'get' => $withTmpStore ? $this->mockTmpStore() : null, ]); } private function mockTmpStore(): TmpStore { - $tmpStore = new TmpStore(); - $tmpStore->setId('test'); - return $tmpStore; + $tmpStore = new TmpStore(); + $tmpStore->setId('test'); + + return $tmpStore; } -} \ No newline at end of file +} diff --git a/tests/Unit/State/Token/Create/ProcessorTest.php b/tests/Unit/State/Token/Create/ProcessorTest.php index 3552a550e..8488f608f 100644 --- a/tests/Unit/State/Token/Create/ProcessorTest.php +++ b/tests/Unit/State/Token/Create/ProcessorTest.php @@ -44,7 +44,6 @@ public function testWrongUriTemplate(): void /** * @throws Exception */ - public function testWrongOperation(): void { $translationProcessor = $this->mockProcessor(); @@ -110,4 +109,4 @@ private function getGetOperation(): Get { return new Get(uriTemplate: '/token/create'); } -} \ No newline at end of file +} diff --git a/tests/Unit/State/Token/Refresh/ProcessorTest.php b/tests/Unit/State/Token/Refresh/ProcessorTest.php index 466d442e4..466b2a1c5 100644 --- a/tests/Unit/State/Token/Refresh/ProcessorTest.php +++ b/tests/Unit/State/Token/Refresh/ProcessorTest.php @@ -43,7 +43,6 @@ public function testWrongUriTemplate(): void /** * @throws Exception */ - public function testWrongOperation(): void { $translationProcessor = $this->mockProcessor(); @@ -101,4 +100,4 @@ private function getGetOperation(): Get { return new Get(uriTemplate: '/token/refresh'); } -} \ No newline at end of file +}