diff --git a/docs/explanation-di-container.md b/docs/explanation-di-container.md index 6026581..d5ee3a3 100644 --- a/docs/explanation-di-container.md +++ b/docs/explanation-di-container.md @@ -53,7 +53,7 @@ Jeder Registrar implementiert das Interface `ContainerRegistrar::register(AppCon // In ServiceFactoryRegistrar: $container->set(UserServicesFactory::class, static fn (AppContainer $c) => new UserServicesFactory( - $c->get(AuditServicesFactory::class), // wird lazy aufgelöst + $c->get(AuthServicesFactory::class), // wird lazy aufgelöst $c->get(UserRepositoryFactory::class), $c->get(UserGatewayFactory::class), $c->get(DatabaseSessionRepository::class) diff --git a/modules/audit/lib/Module/Audit/AuditContainerRegistrar.php b/modules/audit/lib/Module/Audit/AuditContainerRegistrar.php index ef1218f..465c4a4 100644 --- a/modules/audit/lib/Module/Audit/AuditContainerRegistrar.php +++ b/modules/audit/lib/Module/Audit/AuditContainerRegistrar.php @@ -12,12 +12,15 @@ use MintyPHP\Module\Audit\Handler\SystemAuditPurgeJobHandler; use MintyPHP\Module\Audit\Handler\UserLifecycleAuditPurgeJobHandler; use MintyPHP\Module\Audit\Http\ApiSystemAuditReporter; use MintyPHP\Module\Audit\Providers\AuditLayoutProvider; +use MintyPHP\Module\Audit\Repository\ApiAuditLogRepository; +use MintyPHP\Module\Audit\Repository\ImportAuditRunRepository; +use MintyPHP\Module\Audit\Repository\SystemAuditLogRepository; +use MintyPHP\Module\Audit\Repository\UserLifecycleAuditRepository; use MintyPHP\Module\Audit\Service\ApiAuditService; use MintyPHP\Module\Audit\Service\AuditMetadataEnricher; -use MintyPHP\Module\Audit\Service\AuditRepositoryFactory; -use MintyPHP\Module\Audit\Service\AuditServicesFactory; use MintyPHP\Module\Audit\Service\FrontendTelemetryIngestService; use MintyPHP\Module\Audit\Service\ImportAuditService; +use MintyPHP\Module\Audit\Service\SystemAuditRedactionService; use MintyPHP\Module\Audit\Service\SystemAuditService; use MintyPHP\Module\Audit\Service\UserLifecycleAuditService; use MintyPHP\Repository\User\UserReadRepository; @@ -27,30 +30,38 @@ use MintyPHP\Service\Audit\AuditRecorderInterface; use MintyPHP\Service\Audit\ImportAuditInterface; use MintyPHP\Service\Audit\UserLifecycleAuditInterface; use MintyPHP\Service\Security\RateLimiterService; -use MintyPHP\Service\Settings\SettingServicesFactory; use MintyPHP\Service\Settings\SettingsFrontendTelemetryGateway; +use MintyPHP\Service\Settings\SettingsSystemAuditGateway; final class AuditContainerRegistrar implements ContainerRegistrar { public function register(AppContainer $container): void { - // Repository factory - $container->set(AuditRepositoryFactory::class, static fn (): AuditRepositoryFactory => new AuditRepositoryFactory()); + // Repositories + $container->set(SystemAuditLogRepository::class, static fn (): SystemAuditLogRepository => new SystemAuditLogRepository()); + $container->set(ApiAuditLogRepository::class, static fn (): ApiAuditLogRepository => new ApiAuditLogRepository()); + $container->set(UserLifecycleAuditRepository::class, static fn (): UserLifecycleAuditRepository => new UserLifecycleAuditRepository()); + $container->set(ImportAuditRunRepository::class, static fn (): ImportAuditRunRepository => new ImportAuditRunRepository()); - // Services factory - $container->set(AuditServicesFactory::class, static fn (AppContainer $c): AuditServicesFactory => new AuditServicesFactory( - $c->get(AuditRepositoryFactory::class), - $c->get(SettingServicesFactory::class)->createSettingsSystemAuditGateway(), - $c->get(RequestRuntimeInterface::class), - $c->get(SessionStoreInterface::class) - )); + // Redaction + $container->set(SystemAuditRedactionService::class, static fn (): SystemAuditRedactionService => new SystemAuditRedactionService()); // Concrete audit services - $container->set(SystemAuditService::class, static fn (AppContainer $c): SystemAuditService => $c->get(AuditServicesFactory::class)->createSystemAuditService()); - $container->set(ApiAuditService::class, static fn (AppContainer $c): ApiAuditService => $c->get(AuditServicesFactory::class)->createApiAuditService()); - $container->set(UserLifecycleAuditService::class, static fn (AppContainer $c): UserLifecycleAuditService => $c->get(AuditServicesFactory::class)->createUserLifecycleAuditService()); + $container->set(SystemAuditService::class, static fn (AppContainer $c): SystemAuditService => new SystemAuditService( + $c->get(SystemAuditLogRepository::class), + $c->get(SystemAuditRedactionService::class), + $c->get(SettingsSystemAuditGateway::class), + $c->get(SessionStoreInterface::class) + )); + $container->set(ApiAuditService::class, static fn (AppContainer $c): ApiAuditService => new ApiAuditService( + $c->get(ApiAuditLogRepository::class), + $c->get(RequestRuntimeInterface::class) + )); + $container->set(UserLifecycleAuditService::class, static fn (AppContainer $c): UserLifecycleAuditService => new UserLifecycleAuditService( + $c->get(UserLifecycleAuditRepository::class) + )); $container->set(ImportAuditService::class, static fn (AppContainer $c): ImportAuditService => new ImportAuditService( - $c->get(AuditRepositoryFactory::class)->createImportAuditRunRepository() + $c->get(ImportAuditRunRepository::class) )); // Core interface bindings — override null implementations diff --git a/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepository.php b/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepository.php index 193e7db..3af7a35 100644 --- a/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepository.php +++ b/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepository.php @@ -7,7 +7,7 @@ use MintyPHP\Repository\Support\RepoQuery; use MintyPHP\Repository\Support\RepositoryArrayHelper; /** Records API request/response audit entries with status codes, timing, and error details. */ -class ApiAuditLogRepository implements ApiAuditLogRepositoryInterface +class ApiAuditLogRepository { private const FILTER_OPTIONS_LIMIT_MAX = 200; diff --git a/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepositoryInterface.php b/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepositoryInterface.php deleted file mode 100644 index fd981cf..0000000 --- a/modules/audit/lib/Module/Audit/Repository/ApiAuditLogRepositoryInterface.php +++ /dev/null @@ -1,17 +0,0 @@ -apiAuditLogRepository ??= new ApiAuditLogRepository(); - } - - public function createUserLifecycleAuditRepository(): UserLifecycleAuditRepositoryInterface - { - return $this->userLifecycleAuditRepository ??= new UserLifecycleAuditRepository(); - } - - public function createSystemAuditLogRepository(): SystemAuditLogRepositoryInterface - { - return $this->systemAuditLogRepository ??= new SystemAuditLogRepository(); - } - - public function createImportAuditRunRepository(): ImportAuditRunRepositoryInterface - { - return $this->importAuditRunRepository ??= new ImportAuditRunRepository(); - } -} diff --git a/modules/audit/lib/Module/Audit/Service/AuditServicesFactory.php b/modules/audit/lib/Module/Audit/Service/AuditServicesFactory.php deleted file mode 100644 index 525b6bd..0000000 --- a/modules/audit/lib/Module/Audit/Service/AuditServicesFactory.php +++ /dev/null @@ -1,71 +0,0 @@ -auditRepositoryFactory->createApiAuditLogRepository(); - } - - public function createUserLifecycleAuditRepository(): UserLifecycleAuditRepositoryInterface - { - return $this->auditRepositoryFactory->createUserLifecycleAuditRepository(); - } - - public function createSystemAuditLogRepository(): SystemAuditLogRepositoryInterface - { - return $this->auditRepositoryFactory->createSystemAuditLogRepository(); - } - - public function createApiAuditService(): ApiAuditService - { - return $this->apiAuditService ??= new ApiAuditService( - $this->createApiAuditLogRepository(), - $this->requestRuntime - ); - } - - public function createUserLifecycleAuditService(): UserLifecycleAuditService - { - return $this->userLifecycleAuditService ??= new UserLifecycleAuditService( - $this->createUserLifecycleAuditRepository() - ); - } - - public function createSystemAuditRedactionService(): SystemAuditRedactionService - { - return $this->systemAuditRedactionService ??= new SystemAuditRedactionService(); - } - - public function createSystemAuditService(): SystemAuditService - { - return $this->systemAuditService ??= new SystemAuditService( - $this->createSystemAuditLogRepository(), - $this->createSystemAuditRedactionService(), - $this->settingsSystemAuditGateway, - $this->sessionStore - ); - } -} diff --git a/modules/audit/lib/Module/Audit/Service/FrontendTelemetryIngestService.php b/modules/audit/lib/Module/Audit/Service/FrontendTelemetryIngestService.php index e4c6fce..22090f9 100644 --- a/modules/audit/lib/Module/Audit/Service/FrontendTelemetryIngestService.php +++ b/modules/audit/lib/Module/Audit/Service/FrontendTelemetryIngestService.php @@ -4,9 +4,9 @@ namespace MintyPHP\Module\Audit\Service; use DateTimeImmutable; use DateTimeZone; -use MintyPHP\Module\Audit\Domain\SystemAuditOutcome; use MintyPHP\Http\RequestContext; use MintyPHP\Http\SessionStoreInterface; +use MintyPHP\Module\Audit\Domain\SystemAuditOutcome; use MintyPHP\Service\Security\RateLimiterService; use MintyPHP\Service\Settings\SettingsFrontendTelemetryGateway; diff --git a/modules/audit/lib/Module/Audit/Service/ImportAuditService.php b/modules/audit/lib/Module/Audit/Service/ImportAuditService.php index 3ab8d99..3bc63f9 100644 --- a/modules/audit/lib/Module/Audit/Service/ImportAuditService.php +++ b/modules/audit/lib/Module/Audit/Service/ImportAuditService.php @@ -3,7 +3,7 @@ namespace MintyPHP\Module\Audit\Service; use MintyPHP\Module\Audit\Domain\ImportAuditStatus; -use MintyPHP\Module\Audit\Repository\ImportAuditRunRepositoryInterface; +use MintyPHP\Module\Audit\Repository\ImportAuditRunRepository; use MintyPHP\Repository\Support\RepoQuery; use MintyPHP\Service\Audit\ImportAuditInterface; @@ -16,7 +16,7 @@ class ImportAuditService implements ImportAuditInterface */ private array $startedAtByRunId = []; - public function __construct(private readonly ImportAuditRunRepositoryInterface $importAuditRunRepository) + public function __construct(private readonly ImportAuditRunRepository $importAuditRunRepository) { } diff --git a/modules/audit/lib/Module/Audit/Service/SystemAuditService.php b/modules/audit/lib/Module/Audit/Service/SystemAuditService.php index a3a040d..3a672da 100644 --- a/modules/audit/lib/Module/Audit/Service/SystemAuditService.php +++ b/modules/audit/lib/Module/Audit/Service/SystemAuditService.php @@ -2,12 +2,12 @@ namespace MintyPHP\Module\Audit\Service; -use MintyPHP\Module\Audit\Domain\SystemAuditChannel; -use MintyPHP\Module\Audit\Domain\SystemAuditOutcome; use MintyPHP\Http\ApiAuth; use MintyPHP\Http\RequestContext; use MintyPHP\Http\SessionStoreInterface; -use MintyPHP\Module\Audit\Repository\SystemAuditLogRepositoryInterface; +use MintyPHP\Module\Audit\Domain\SystemAuditChannel; +use MintyPHP\Module\Audit\Domain\SystemAuditOutcome; +use MintyPHP\Module\Audit\Repository\SystemAuditLogRepository; use MintyPHP\Repository\Support\RepoQuery; use MintyPHP\Service\Audit\AuditRecorderInterface; use MintyPHP\Service\Settings\SettingsSystemAuditGateway; @@ -19,7 +19,7 @@ class SystemAuditService implements AuditRecorderInterface private const RETENTION_DAYS_FALLBACK = 365; public function __construct( - private readonly SystemAuditLogRepositoryInterface $systemAuditLogRepository, + private readonly SystemAuditLogRepository $systemAuditLogRepository, private readonly SystemAuditRedactionService $systemAuditRedactionService, private readonly SettingsSystemAuditGateway $settingsSystemAuditGateway, private readonly SessionStoreInterface $sessionStore diff --git a/modules/audit/lib/Module/Audit/Service/UserLifecycleAuditService.php b/modules/audit/lib/Module/Audit/Service/UserLifecycleAuditService.php index 68a3ed2..8d1a99e 100644 --- a/modules/audit/lib/Module/Audit/Service/UserLifecycleAuditService.php +++ b/modules/audit/lib/Module/Audit/Service/UserLifecycleAuditService.php @@ -5,7 +5,7 @@ namespace MintyPHP\Module\Audit\Service; use MintyPHP\Module\Audit\Domain\UserLifecycleAction; use MintyPHP\Module\Audit\Domain\UserLifecycleStatus; use MintyPHP\Module\Audit\Domain\UserLifecycleTriggerType; -use MintyPHP\Module\Audit\Repository\UserLifecycleAuditRepositoryInterface; +use MintyPHP\Module\Audit\Repository\UserLifecycleAuditRepository; use MintyPHP\Service\Audit\UserLifecycleAuditInterface; use MintyPHP\Support\Crypto; @@ -43,7 +43,7 @@ class UserLifecycleAuditService implements UserLifecycleAuditInterface 'active_changed_at', ]; - public function __construct(private readonly UserLifecycleAuditRepositoryInterface $userLifecycleAuditRepository) + public function __construct(private readonly UserLifecycleAuditRepository $userLifecycleAuditRepository) { } diff --git a/modules/audit/pages/audit/frontend-telemetry/ingest().php b/modules/audit/pages/audit/frontend-telemetry/ingest().php index cb94d32..da32948 100644 --- a/modules/audit/pages/audit/frontend-telemetry/ingest().php +++ b/modules/audit/pages/audit/frontend-telemetry/ingest().php @@ -2,8 +2,8 @@ use MintyPHP\Http\RequestContext; use MintyPHP\Http\SessionStoreInterface; -use MintyPHP\Router; use MintyPHP\Module\Audit\Service\FrontendTelemetryIngestService; +use MintyPHP\Router; use MintyPHP\Session; if ((requestInput()->method()) !== 'POST') { diff --git a/modules/audit/pages/audit/system-audit/index().php b/modules/audit/pages/audit/system-audit/index().php index e789bde..f22f23c 100644 --- a/modules/audit/pages/audit/system-audit/index().php +++ b/modules/audit/pages/audit/system-audit/index().php @@ -4,7 +4,6 @@ use MintyPHP\Buffer; use MintyPHP\Http\SessionStoreInterface; use MintyPHP\Module\Audit\AuditAuthorizationPolicy; use MintyPHP\Module\Audit\Service\SystemAuditService; -use MintyPHP\Service\Access\SettingsAuthorizationPolicy; use MintyPHP\Service\Access\UiAccessService; use MintyPHP\Support\Guard; diff --git a/modules/audit/tests/Module/Audit/Service/ApiAuditServiceTest.php b/modules/audit/tests/Module/Audit/Service/ApiAuditServiceTest.php index 1ddc793..97f6239 100644 --- a/modules/audit/tests/Module/Audit/Service/ApiAuditServiceTest.php +++ b/modules/audit/tests/Module/Audit/Service/ApiAuditServiceTest.php @@ -4,7 +4,7 @@ namespace MintyPHP\Tests\Module\Audit\Service; use MintyPHP\Http\RequestContext; use MintyPHP\Http\RequestRuntime; -use MintyPHP\Module\Audit\Repository\ApiAuditLogRepositoryInterface; +use MintyPHP\Module\Audit\Repository\ApiAuditLogRepository; use MintyPHP\Module\Audit\Service\ApiAuditService; use PHPUnit\Framework\TestCase; @@ -30,7 +30,7 @@ class ApiAuditServiceTest extends TestCase public function testCurrentRequestIdIsNullBeforeStart(): void { $service = new ApiAuditService( - $this->createMock(ApiAuditLogRepositoryInterface::class), + $this->createMock(ApiAuditLogRepository::class), new RequestRuntime() ); $this->assertNull($service->currentRequestId()); @@ -43,7 +43,7 @@ class ApiAuditServiceTest extends TestCase $_GET = ['x' => '1']; $service = new ApiAuditService( - $this->createMock(ApiAuditLogRepositoryInterface::class), + $this->createMock(ApiAuditLogRepository::class), new RequestRuntime() ); $service->startRequestContext(); @@ -66,7 +66,7 @@ class ApiAuditServiceTest extends TestCase $_GET = []; $service = new ApiAuditService( - $this->createMock(ApiAuditLogRepositoryInterface::class), + $this->createMock(ApiAuditLogRepository::class), new RequestRuntime() ); $service->startRequestContext(); diff --git a/modules/audit/tests/Module/Audit/Service/UserLifecycleAuditServiceTest.php b/modules/audit/tests/Module/Audit/Service/UserLifecycleAuditServiceTest.php index a3dac24..278a2ff 100644 --- a/modules/audit/tests/Module/Audit/Service/UserLifecycleAuditServiceTest.php +++ b/modules/audit/tests/Module/Audit/Service/UserLifecycleAuditServiceTest.php @@ -2,7 +2,7 @@ namespace MintyPHP\Tests\Module\Audit\Service; -use MintyPHP\Module\Audit\Repository\UserLifecycleAuditRepositoryInterface; +use MintyPHP\Module\Audit\Repository\UserLifecycleAuditRepository; use MintyPHP\Module\Audit\Service\UserLifecycleAuditService; use MintyPHP\Support\Crypto; use PHPUnit\Framework\TestCase; @@ -52,7 +52,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testLogDeactivateCallsRepoCreateWithCorrectRow(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -87,7 +87,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testLogDeactivateReturnsFalseOnRepoException(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->method('create')->willThrowException(new \RuntimeException('db error')); $service = new UserLifecycleAuditService($repo); @@ -98,7 +98,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testLogDeactivateReturnsFalseWhenRepoReturnsFalse(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->method('create')->willReturn(false); $service = new UserLifecycleAuditService($repo); @@ -122,7 +122,7 @@ class UserLifecycleAuditServiceTest extends TestCase $targetUser['id'] = 5; $targetUser['extra_field'] = 'should_be_excluded'; - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -149,7 +149,7 @@ class UserLifecycleAuditServiceTest extends TestCase $targetUser = ['id' => 5, 'uuid' => 'u5', 'email' => 'e@example.com', 'extra' => 'no']; $capturedRow = null; - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row) use (&$capturedRow): bool { @@ -176,7 +176,7 @@ class UserLifecycleAuditServiceTest extends TestCase // cause the try/catch to fire. We cannot easily override static Crypto, but we // know that if APP_CRYPTO_KEY were missing, encryptString would throw. // Since we defined a valid key, let's test the repo exception path instead. - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->method('create')->willThrowException(new \RuntimeException('db error')); $service = new UserLifecycleAuditService($repo); @@ -189,7 +189,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testLogRestoreCallsRepoWithRestoreAction(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -207,7 +207,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testLogRestoreReturnsFalseOnException(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->method('create')->willThrowException(new \RuntimeException('fail')); $service = new UserLifecycleAuditService($repo); @@ -227,7 +227,7 @@ class UserLifecycleAuditServiceTest extends TestCase $original = ['uuid' => 'test-uuid', 'email' => 'test@example.com']; $encrypted = Crypto::encryptString(json_encode($original)); - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $service = new UserLifecycleAuditService($repo); $result = $service->decryptSnapshot(['snapshot_enc' => $encrypted]); @@ -236,7 +236,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testDecryptSnapshotReturnsNullForEmptyPayload(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $service = new UserLifecycleAuditService($repo); $this->assertNull($service->decryptSnapshot([])); @@ -246,7 +246,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testDecryptSnapshotReturnsNullForInvalidPayload(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $service = new UserLifecycleAuditService($repo); $result = $service->decryptSnapshot(['snapshot_enc' => 'not-valid-encrypted-data']); @@ -257,7 +257,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testMarkDeleteEventRestoredDelegatesToRepo(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('markRestored') ->with(1, 99, 200) @@ -269,7 +269,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testMarkDeleteEventRestoredReturnsFalseOnException(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->method('markRestored')->willThrowException(new \RuntimeException('fail')); $service = new UserLifecycleAuditService($repo); @@ -280,7 +280,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testPurgeExpiredDelegatesToRepoWith365Days(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('purgeOlderThanDays') ->with(365) @@ -294,7 +294,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testBuildBaseRowNormalizesInvalidTriggerTypeToDefault(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -308,7 +308,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testBuildBaseRowNormalizesInvalidStatusToFailed(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -322,7 +322,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testBuildBaseRowNormalizesNullActorToNull(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -336,7 +336,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testBuildBaseRowNormalizesZeroActorToNull(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { @@ -350,7 +350,7 @@ class UserLifecycleAuditServiceTest extends TestCase public function testBuildBaseRowSetsNegativePolicyDaysToZero(): void { - $repo = $this->createMock(UserLifecycleAuditRepositoryInterface::class); + $repo = $this->createMock(UserLifecycleAuditRepository::class); $repo->expects($this->once()) ->method('create') ->with($this->callback(static function (array $row): bool { diff --git a/tests/Architecture/ContainerFactoryContractTest.php b/tests/Architecture/ContainerFactoryContractTest.php index 47ddec4..f1b770c 100644 --- a/tests/Architecture/ContainerFactoryContractTest.php +++ b/tests/Architecture/ContainerFactoryContractTest.php @@ -16,8 +16,6 @@ class ContainerFactoryContractTest extends TestCase { return [ [\MintyPHP\Service\Access\AccessServicesFactory::class], - [\MintyPHP\Module\AddressBook\Service\AddressBookServicesFactory::class], - [\MintyPHP\Module\Audit\Service\AuditServicesFactory::class], [\MintyPHP\Service\Auth\AuthServicesFactory::class], [\MintyPHP\Service\Branding\BrandingServicesFactory::class], [\MintyPHP\Service\Directory\DirectoryServicesFactory::class],