refactor(arch): enforce gateway compliance and remove service-wrapping gateways

This commit is contained in:
2026-03-13 11:31:33 +01:00
parent 082fa4c9a5
commit 892da0048d
96 changed files with 1117 additions and 1060 deletions

View File

@@ -7,11 +7,11 @@ use MintyPHP\Repository\User\UserListQueryRepositoryInterface;
use MintyPHP\Repository\User\UserReadRepositoryInterface;
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
use MintyPHP\Service\Audit\SystemAuditService;
use MintyPHP\Service\Tenant\TenantScopeService;
use MintyPHP\Service\User\UserAccountService;
use MintyPHP\Service\User\UserAssignmentService;
use MintyPHP\Service\User\UserDirectoryGateway;
use MintyPHP\Service\User\UserPasswordService;
use MintyPHP\Service\User\UserScopeGateway;
use MintyPHP\Service\User\UserSettingsGateway;
use PHPUnit\Framework\TestCase;
@@ -19,7 +19,7 @@ class UserAccountServiceTest extends TestCase
{
public function testListPagedDropsTenantUserIdForGlobalAccess(): void
{
$scopeGateway = $this->createMock(UserScopeGateway::class);
$scopeGateway = $this->createMock(TenantScopeService::class);
$scopeGateway->expects($this->once())
->method('hasGlobalAccess')
->with(99)
@@ -109,7 +109,7 @@ class UserAccountServiceTest extends TestCase
$readRepository = $this->createMock(UserReadRepositoryInterface::class);
$readRepository->method('findByUuid')->willReturn(['id' => 51, 'uuid' => 'other-uuid']);
$scopeGateway = $this->createMock(UserScopeGateway::class);
$scopeGateway = $this->createMock(TenantScopeService::class);
$scopeGateway->method('canAccess')->willReturn(false);
$writeRepository = $this->createMock(UserWriteRepositoryInterface::class);
@@ -209,7 +209,7 @@ class UserAccountServiceTest extends TestCase
['u-2', ['id' => 12, 'uuid' => 'u-2']],
]);
$scopeGateway = $this->createMock(UserScopeGateway::class);
$scopeGateway = $this->createMock(TenantScopeService::class);
$scopeGateway->method('canAccess')->willReturn(true);
$auditService = $this->createMock(SystemAuditService::class);
@@ -539,7 +539,7 @@ class UserAccountServiceTest extends TestCase
?UserAssignmentService $assignmentService = null,
?UserPasswordService $passwordService = null,
?UserSettingsGateway $settingsGateway = null,
?UserScopeGateway $scopeGateway = null,
?TenantScopeService $scopeGateway = null,
?UserDirectoryGateway $directoryGateway = null,
?SystemAuditService $auditService = null,
?DatabaseSessionRepository $databaseSessionRepository = null
@@ -576,7 +576,7 @@ class UserAccountServiceTest extends TestCase
}
if ($scopeGateway === null) {
$scopeGateway = $this->createMock(UserScopeGateway::class);
$scopeGateway = $this->createMock(TenantScopeService::class);
$scopeGateway->method('hasGlobalAccess')->willReturn(false);
$scopeGateway->method('canAccess')->willReturn(false);
}