wip: bulk insurance refactoring

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent a3d7ee63d3
commit 1f5c835f8a
9 changed files with 359 additions and 51 deletions
@@ -17,6 +17,7 @@ use App\BusProNet\Model\Travel;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Service\InsuranceMatchingService;
use App\Service\InsuranceTypeFilterService;
use PHPUnit\Framework\TestCase;
/**
@@ -34,7 +35,12 @@ class BookingDataProcessorTest extends TestCase
// Create a mock InsuranceMatchingService
$insuranceMatchingService = $this->createMock(InsuranceMatchingService::class);
$this->processor = new BookingDataProcessor($insuranceMatchingService);
// Create a mock InsuranceTypeFilterService that simply returns the input
$insuranceTypeFilterService = $this->createMock(InsuranceTypeFilterService::class);
$insuranceTypeFilterService->method('filterNonComplementary')
->willReturnArgument(0);
$this->processor = new BookingDataProcessor($insuranceMatchingService, $insuranceTypeFilterService);
}
public function testCreateUpdateRequestPayloadWithCompleteData(): void
@@ -10,6 +10,7 @@ use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Form\Service\ParticipantInsuranceFieldHandler;
use App\Service\InsuranceMatchingService;
use App\Service\InsuranceTypeFilterService;
use PHPUnit\Framework\TestCase;
class ParticipantInsuranceFieldHandlerTest extends TestCase
@@ -20,7 +21,12 @@ class ParticipantInsuranceFieldHandlerTest extends TestCase
protected function setUp(): void
{
$this->insuranceMatchingService = $this->createMock(InsuranceMatchingService::class);
$this->handler = new ParticipantInsuranceFieldHandler($this->insuranceMatchingService);
$insuranceTypeFilterService = $this->createMock(InsuranceTypeFilterService::class);
$insuranceTypeFilterService->method('filterNonComplementary')
->willReturnArgument(0);
$this->handler = new ParticipantInsuranceFieldHandler($this->insuranceMatchingService, $insuranceTypeFilterService);
}
public function testGetFieldName(): void