refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -8,7 +8,7 @@ use MintyPHP\Http\SessionStoreInterface;
|
||||
use MintyPHP\Repository\Auth\RememberTokenRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserReadRepositoryInterface;
|
||||
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
|
||||
use MintyPHP\Service\Auth\AuthPermissionGateway;
|
||||
use MintyPHP\Service\Access\PermissionService;
|
||||
use MintyPHP\Service\Auth\AuthSessionTenantContextService;
|
||||
use MintyPHP\Service\Auth\AuthSettingsGateway;
|
||||
use MintyPHP\Service\Auth\RememberMeService;
|
||||
@@ -303,8 +303,8 @@ class RememberMeServiceTest extends TestCase
|
||||
$userRead = $this->createMock(UserReadRepositoryInterface::class);
|
||||
$userRead->method('find')->willReturn(['id' => 5, 'active' => 1]);
|
||||
|
||||
$permGateway = $this->createMock(AuthPermissionGateway::class);
|
||||
$permGateway->expects($this->once())->method('warmUserPermissions')->with(5, true);
|
||||
$permService = $this->createMock(PermissionService::class);
|
||||
$permService->expects($this->once())->method('getUserPermissions')->with(5, true);
|
||||
|
||||
$tenantCtx = $this->createMock(AuthSessionTenantContextService::class);
|
||||
$tenantCtx->expects($this->once())->method('hydrateForUser')->with(5);
|
||||
@@ -318,7 +318,7 @@ class RememberMeServiceTest extends TestCase
|
||||
tokenRepository: $tokenRepo,
|
||||
userReadRepository: $userRead,
|
||||
userWriteRepository: $userWrite,
|
||||
permissionGateway: $permGateway,
|
||||
permissionService: $permService,
|
||||
authSessionTenantContextService: $tenantCtx
|
||||
);
|
||||
$this->assertTrue($service->autoLoginFromCookie());
|
||||
@@ -511,7 +511,7 @@ class RememberMeServiceTest extends TestCase
|
||||
?UserReadRepositoryInterface $userReadRepository = null,
|
||||
?UserWriteRepositoryInterface $userWriteRepository = null,
|
||||
?RememberTokenRepositoryInterface $tokenRepository = null,
|
||||
?AuthPermissionGateway $permissionGateway = null,
|
||||
?PermissionService $permissionService = null,
|
||||
?AuthSessionTenantContextService $authSessionTenantContextService = null,
|
||||
?SessionStoreInterface $sessionStore = null,
|
||||
?CookieStoreInterface $cookieStore = null,
|
||||
@@ -556,7 +556,7 @@ class RememberMeServiceTest extends TestCase
|
||||
$userReadRepository ?? $this->createMock(UserReadRepositoryInterface::class),
|
||||
$userWriteRepository ?? $this->createMock(UserWriteRepositoryInterface::class),
|
||||
$tokenRepository ?? $this->createMock(RememberTokenRepositoryInterface::class),
|
||||
$permissionGateway ?? $this->createMock(AuthPermissionGateway::class),
|
||||
$permissionService ?? $this->createMock(PermissionService::class),
|
||||
$authSessionTenantContextService ?? $this->createMock(AuthSessionTenantContextService::class),
|
||||
$sessionStore ?? $this->createMock(SessionStoreInterface::class),
|
||||
$cookieStore ?? $this->createMock(CookieStoreInterface::class),
|
||||
|
||||
Reference in New Issue
Block a user