feat: offer non-travelling applicant choice only on selected travels
This commit is contained in:
1 parent
38f0f23ea3
commit
55a9189284
9 files changed
+320
-26
No files matched your search
@@ -148,6 +148,48 @@ class BookingDtoTest extends TestCase
|
||||
$this->assertFalse($dto->isFirstParticipantApplicant());
|
||||
}
|
||||
|
||||
public function testRestoringTheTravellingApplicantEndsTheSplit(): void
|
||||
{
|
||||
$dto = $this->createCreateModeDto();
|
||||
$dto->applicantTravels = false;
|
||||
|
||||
$applicant = new ParticipantDto();
|
||||
$applicant->firstName = 'Elternteil';
|
||||
$dto->applicant = $applicant;
|
||||
|
||||
$child = new ParticipantDto();
|
||||
$child->index = 0;
|
||||
$child->firstName = 'Kind';
|
||||
$child->assignedRoomId = 1408;
|
||||
$sibling = new ParticipantDto();
|
||||
$sibling->index = 1;
|
||||
$dto->participants = [$child, $sibling];
|
||||
|
||||
$dto->restoreTravellingApplicant();
|
||||
|
||||
$this->assertTrue($dto->applicantTravels);
|
||||
$this->assertNull($dto->applicant);
|
||||
$this->assertSame($applicant, $dto->participants[0]);
|
||||
$this->assertSame(0, $applicant->index);
|
||||
$this->assertSame(1408, $applicant->assignedRoomId, 'The slot keeps its room');
|
||||
$this->assertSame($sibling, $dto->participants[1]);
|
||||
}
|
||||
|
||||
public function testRestoringWithoutAnApplicantRecordKeepsTheFirstParticipant(): void
|
||||
{
|
||||
$dto = $this->createCreateModeDto();
|
||||
$dto->applicantTravels = false;
|
||||
|
||||
$traveller = new ParticipantDto();
|
||||
$traveller->index = 0;
|
||||
$dto->participants = [$traveller];
|
||||
|
||||
$dto->restoreTravellingApplicant();
|
||||
|
||||
$this->assertTrue($dto->applicantTravels);
|
||||
$this->assertSame($traveller, $dto->participants[0]);
|
||||
}
|
||||
|
||||
public function testInternalAgencyBookingNeverHasTheFirstParticipantAsApplicantInEditMode(): void
|
||||
{
|
||||
$dto = $this->createEditModeDto(100, 100);
|
||||
|
||||
Reference in new issue
Block a user