fix: restore room occupancy lost to case-sensitive xml attribute lookup

This commit is contained in:
Björn Fromme
2026-08-31 14:15:21 +02:00
parent 24df764efb
commit e14d29f7d4
10 changed files with 223 additions and 16 deletions
+26
View File
@@ -272,6 +272,32 @@ class RoomAssignerTest extends TestCase
self::assertNull($bookingDto->participants[1]->assignedRoomId);
}
#[Test]
public function assignParticipantsToRoomsFallsBackToOneBedWhenOccupancyIsUnknown(): void
{
$bookingDto = $this->createBookingDtoWithRoomSelections([
['roomId' => 100, 'quantity' => 2, 'capacity' => 1],
]);
$bookingDto->participants = [
new ParticipantDto(),
new ParticipantDto(),
];
$room = new Room();
$room->id = 100;
$room->minPax = null;
$room->available = 10;
$room->status = Constants::STATUS_AVAILABLE;
$bookingDto->travel->rooms = [$room];
$this->service->assignParticipantsToRooms($bookingDto);
self::assertSame(100, $bookingDto->participants[0]->assignedRoomId);
self::assertSame(100, $bookingDto->participants[1]->assignedRoomId);
}
private function createBookingDtoWithRoomSelections(array $selections): BookingDto
{
$travel = new Travel();