refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user