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

@@ -3,7 +3,7 @@
namespace MintyPHP\Tests\Service\Import;
use MintyPHP\Http\SessionStoreInterface;
use MintyPHP\Service\Access\PermissionGateway;
use MintyPHP\Service\Access\PermissionService;
use MintyPHP\Service\Audit\ImportAuditService;
use MintyPHP\Service\Import\CsvReaderService;
use MintyPHP\Service\Import\ImportService;
@@ -11,7 +11,7 @@ use MintyPHP\Service\Import\ImportStateStoreService;
use MintyPHP\Service\Import\ImportTempFileService;
use MintyPHP\Service\Import\Profile\ImportProfileInterface;
use MintyPHP\Service\Settings\SettingsDefaultsGateway;
use MintyPHP\Service\User\UserScopeGateway;
use MintyPHP\Service\Tenant\TenantScopeService;
use PHPUnit\Framework\TestCase;
class ImportServiceTest extends TestCase
@@ -119,12 +119,12 @@ class ImportServiceTest extends TestCase
$tempFileService = $tempFileService ?? $this->createMock(ImportTempFileService::class);
$auditService = $this->createMock(ImportAuditService::class);
$stateStore = $stateStore ?? $this->createMock(ImportStateStoreService::class);
$permissionGateway = $this->createMock(PermissionGateway::class);
$permissionGateway->method('userHas')->willReturn(false);
$permissionService = $this->createMock(PermissionService::class);
$permissionService->method('userHas')->willReturn(false);
$settingsDefaultsGateway = $this->createMock(SettingsDefaultsGateway::class);
$userScopeGateway = $this->createMock(UserScopeGateway::class);
$userScopeGateway->method('hasGlobalAccess')->willReturn(false);
$userScopeGateway->method('getUserTenantIds')->willReturn([]);
$tenantScopeService = $this->createMock(TenantScopeService::class);
$tenantScopeService->method('hasGlobalAccess')->willReturn(false);
$tenantScopeService->method('getUserTenantIds')->willReturn([]);
$sessionStore = $this->createMock(SessionStoreInterface::class);
$sessionStore->method('get')->willReturn([]);
@@ -134,9 +134,9 @@ class ImportServiceTest extends TestCase
$auditService,
$stateStore,
[$profile->key() => $profile],
$permissionGateway,
$permissionService,
$settingsDefaultsGateway,
$userScopeGateway,
$tenantScopeService,
$sessionStore
);
}