Repo Interface für tests
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user