fix: exclude cancelled participants' services from price breakdown
This commit is contained in:
1 parent
553ec901f3
commit
849a19b67a
4 files changed
+74
-4
No files matched your search
@@ -100,6 +100,27 @@ class BookingConfiguratorBabyTest extends TestCase
|
||||
$this->assertSame('Mandatory Service', $participant->additionalServices[0]->label);
|
||||
}
|
||||
|
||||
public function testPreselectMandatoryServicesSkipsCanceledParticipant(): void
|
||||
{
|
||||
$travel = $this->createTravelWithMandatoryServices();
|
||||
$bookingDto = new BookingDto($travel, 1);
|
||||
|
||||
$participant = new ParticipantDto();
|
||||
$participant->index = 0;
|
||||
$participant->status = 'S';
|
||||
$participant->dateOfBirth = $travel->dateFrom->modify('-25 years');
|
||||
$participant->additionalServices = [];
|
||||
$bookingDto->participants[0] = $participant;
|
||||
|
||||
$this->participantEligibilityService
|
||||
->method('isParticipantEligible')
|
||||
->willReturn(true);
|
||||
|
||||
$this->bookingService()->preselectDefaultServices($bookingDto);
|
||||
|
||||
$this->assertSame([], $participant->additionalServices, 'Mandatory services should not be preselected for cancelled participants');
|
||||
}
|
||||
|
||||
public function testPreselectMandatoryServicesIncludesAdultParticipant(): void
|
||||
{
|
||||
$travel = $this->createTravelWithMandatoryServices();
|
||||
|
||||
Reference in new issue
Block a user