feat: upgrade phpunit to 12.5
This commit is contained in:
@@ -40,8 +40,8 @@ class BookingDataProcessorTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
// Create a mock InsuranceManager
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
|
||||
// Mock getSelectableInsurances to return empty array (not used in these tests)
|
||||
$insuranceService->method('getSelectableInsurances')
|
||||
@@ -851,7 +851,7 @@ class BookingDataProcessorTest extends TestCase
|
||||
$bookingDto = new BookingDto($this->createMockTravel(), 1);
|
||||
$bookingDto->participants = [$applicant, $dependent];
|
||||
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
// Both insurances must already look eligible, otherwise the submit-time
|
||||
// reconciliation step (added for stale-insurance re-validation) would clear
|
||||
// them before propagation even runs - this test is only about propagation.
|
||||
@@ -864,11 +864,11 @@ class BookingDataProcessorTest extends TestCase
|
||||
1 => null,
|
||||
]);
|
||||
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
$priceCalculatorService->method('calculateIndividualParticipantPriceExcludingInsurance')->willReturn(0.0);
|
||||
$priceCalculatorService->method('resolveInsuranceTravelPrice')->willReturn(0.0);
|
||||
|
||||
$payloadBuilder = $this->createMock(BookingPayloadBuilder::class);
|
||||
$payloadBuilder = $this->createStub(BookingPayloadBuilder::class);
|
||||
$payloadBuilder->method('buildCreatePayload')->willReturn([]);
|
||||
|
||||
$processor = new BookingDataProcessor(
|
||||
@@ -911,14 +911,14 @@ class BookingDataProcessorTest extends TestCase
|
||||
$dependent = $formData->participants[1];
|
||||
$dependent->insurance = $dependentInsurance;
|
||||
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
$insuranceService->method('getSelectableInsurances')->willReturn([]);
|
||||
$insuranceService->method('batchAssignInsuranceToParticipants')->willReturn([
|
||||
0 => $familyInsurance,
|
||||
1 => null,
|
||||
]);
|
||||
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
$priceCalculatorService->method('calculateIndividualParticipantPriceExcludingInsurance')->willReturn(0.0);
|
||||
|
||||
$processor = new BookingDataProcessor(
|
||||
@@ -961,18 +961,18 @@ class BookingDataProcessorTest extends TestCase
|
||||
$bookingDto = new BookingDto($this->createMockTravel(), 1);
|
||||
$bookingDto->participants = [$applicant];
|
||||
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
$insuranceService->method('getSelectableInsurances')->willReturn([$staleInsurance, $correctTierInsurance]);
|
||||
// Only the higher tier is eligible at the current (updated) price.
|
||||
$insuranceService->method('getEligibleInsurances')->willReturn([$correctTierInsurance]);
|
||||
$insuranceService->method('reassignInsuranceForPriceChange')->willReturn($correctTierInsurance);
|
||||
$insuranceService->method('batchAssignInsuranceToParticipants')->willReturn([0 => $correctTierInsurance]);
|
||||
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
$priceCalculatorService->method('calculateIndividualParticipantPriceExcludingInsurance')->willReturn(0.0);
|
||||
$priceCalculatorService->method('resolveInsuranceTravelPrice')->willReturn(2600.0);
|
||||
|
||||
$payloadBuilder = $this->createMock(BookingPayloadBuilder::class);
|
||||
$payloadBuilder = $this->createStub(BookingPayloadBuilder::class);
|
||||
$payloadBuilder->method('buildCreatePayload')->willReturn([]);
|
||||
|
||||
$processor = new BookingDataProcessor(
|
||||
@@ -1009,17 +1009,17 @@ class BookingDataProcessorTest extends TestCase
|
||||
$bookingDto = new BookingDto($this->createMockTravel(), 1);
|
||||
$bookingDto->participants = [$applicant];
|
||||
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
$insuranceService->method('getSelectableInsurances')->willReturn([$staleInsurance]);
|
||||
$insuranceService->method('getEligibleInsurances')->willReturn([]);
|
||||
$insuranceService->method('reassignInsuranceForPriceChange')->willReturn(null);
|
||||
$insuranceService->method('batchAssignInsuranceToParticipants')->willReturn([0 => null]);
|
||||
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
$priceCalculatorService->method('calculateIndividualParticipantPriceExcludingInsurance')->willReturn(0.0);
|
||||
$priceCalculatorService->method('resolveInsuranceTravelPrice')->willReturn(9999.0);
|
||||
|
||||
$payloadBuilder = $this->createMock(BookingPayloadBuilder::class);
|
||||
$payloadBuilder = $this->createStub(BookingPayloadBuilder::class);
|
||||
$payloadBuilder->method('buildCreatePayload')->willReturn([]);
|
||||
|
||||
$processor = new BookingDataProcessor(
|
||||
@@ -1056,16 +1056,16 @@ class BookingDataProcessorTest extends TestCase
|
||||
$bookingDto = new BookingDto($this->createMockTravel(), 1);
|
||||
$bookingDto->participants = [$applicant];
|
||||
|
||||
$insuranceService = $this->createMock(InsuranceManager::class);
|
||||
$insuranceService = $this->createStub(InsuranceManager::class);
|
||||
$insuranceService->method('getSelectableInsurances')->willReturn([$insurance]);
|
||||
$insuranceService->method('getEligibleInsurances')->willReturn([$insurance]);
|
||||
$insuranceService->method('batchAssignInsuranceToParticipants')->willReturn([0 => $insurance]);
|
||||
|
||||
$priceCalculatorService = $this->createMock(BookingPriceCalculator::class);
|
||||
$priceCalculatorService = $this->createStub(BookingPriceCalculator::class);
|
||||
$priceCalculatorService->method('calculateIndividualParticipantPriceExcludingInsurance')->willReturn(0.0);
|
||||
$priceCalculatorService->method('resolveInsuranceTravelPrice')->willReturn(500.0);
|
||||
|
||||
$payloadBuilder = $this->createMock(BookingPayloadBuilder::class);
|
||||
$payloadBuilder = $this->createStub(BookingPayloadBuilder::class);
|
||||
$payloadBuilder->method('buildCreatePayload')->willReturn([]);
|
||||
|
||||
$processor = new BookingDataProcessor(
|
||||
|
||||
Reference in New Issue
Block a user