Repo Interface für tests

This commit is contained in:
2026-03-05 08:26:51 +01:00
parent 8f4dd5840d
commit 4b31fc7664
171 changed files with 3518 additions and 2297 deletions

View File

@@ -2,7 +2,7 @@
namespace MintyPHP\Tests\Service\Audit;
use MintyPHP\Repository\Audit\ApiAuditLogRepository;
use MintyPHP\Repository\Audit\ApiAuditLogRepositoryInterface;
use MintyPHP\Service\Audit\ApiAuditService;
use MintyPHP\Http\RequestContext;
use PHPUnit\Framework\TestCase;
@@ -28,7 +28,7 @@ class ApiAuditServiceTest extends TestCase
public function testCurrentRequestIdIsNullBeforeStart(): void
{
$service = new ApiAuditService(new ApiAuditLogRepository());
$service = new ApiAuditService($this->createMock(ApiAuditLogRepositoryInterface::class));
$this->assertNull($service->currentRequestId());
}
@@ -38,7 +38,7 @@ class ApiAuditServiceTest extends TestCase
$_SERVER['REQUEST_URI'] = '/api/v1/me?x=1';
$_GET = ['x' => '1'];
$service = new ApiAuditService(new ApiAuditLogRepository());
$service = new ApiAuditService($this->createMock(ApiAuditLogRepositoryInterface::class));
$service->startRequestContext();
$requestId = $service->currentRequestId();
@@ -58,7 +58,7 @@ class ApiAuditServiceTest extends TestCase
$_SERVER['REQUEST_URI'] = '/api/v1/me';
$_GET = [];
$service = new ApiAuditService(new ApiAuditLogRepository());
$service = new ApiAuditService($this->createMock(ApiAuditLogRepositoryInterface::class));
$service->startRequestContext();
$this->assertNull($service->currentRequestId());