Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon authored and github-actions[bot] committed Mar 4, 2024
1 parent 0ad438e commit 524333a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tests/Unit/Dto/Token/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function testTokenCreate(): void
$this->assertSame('token', $create->getUsername());
$this->assertSame('test', $create->getPassword());
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Dto/Token/InfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public function testTokenInfo(): void
$this->assertSame('token', $info->getToken());
$this->assertSame('test', $info->getUsername());
}
}
}
4 changes: 2 additions & 2 deletions tests/Unit/Dto/Token/OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Dto/Token/RefreshTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function testTokenRefresh(): void
$refresh = new Refresh('token');
$this->assertSame('token', $refresh->getToken());
}
}
}
24 changes: 11 additions & 13 deletions tests/Unit/Service/Security/SecurityServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;


final class SecurityServiceTest extends Unit
{
/**
Expand All @@ -43,7 +42,6 @@ public function testSecurityService(): void
/**
* @throws Exception
*/

public function testInvalidPassword(): void
{
$securityService = $this->mockSecurityService(false);
Expand All @@ -52,7 +50,6 @@ public function testInvalidPassword(): void
$securityService->authenticateUser(new Create('test', 'test'));
}


/**
* @throws Exception
*/
Expand Down Expand Up @@ -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',
]);
}
},
]);
}

Expand All @@ -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'),
]);
}

Expand All @@ -126,7 +123,7 @@ private function mockUserProviderWithOutUser(): UserProvider
private function mockPasswordHasher($validPassword = true): UserPasswordHasherInterface
{
return $this->makeEmpty(UserPasswordHasherInterface::class, [
'isPasswordValid' => $validPassword
'isPasswordValid' => $validPassword,
]);
}

Expand All @@ -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;
}
}
}
3 changes: 1 addition & 2 deletions tests/Unit/State/Token/Create/ProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function testWrongUriTemplate(): void
/**
* @throws Exception
*/

public function testWrongOperation(): void
{
$translationProcessor = $this->mockProcessor();
Expand Down Expand Up @@ -110,4 +109,4 @@ private function getGetOperation(): Get
{
return new Get(uriTemplate: '/token/create');
}
}
}
3 changes: 1 addition & 2 deletions tests/Unit/State/Token/Refresh/ProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function testWrongUriTemplate(): void
/**
* @throws Exception
*/

public function testWrongOperation(): void
{
$translationProcessor = $this->mockProcessor();
Expand Down Expand Up @@ -101,4 +100,4 @@ private function getGetOperation(): Get
{
return new Get(uriTemplate: '/token/refresh');
}
}
}

0 comments on commit 524333a

Please sign in to comment.