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

This commit is contained in:
Björn Fromme committed 2026-08-31 14:15:21 +02:00
1 parent 24df764efb
commit e14d29f7d4
10 files changed
+223 -16

No files matched your search

+18 -1
View File
@@ -70,6 +70,23 @@ class BookingSummaryAssemblerTest extends TestCase
$this->assertSame(2, $summary->participantCount);
}
public function testCreateStep1CountsRoomsWithUnknownOccupancyAsZero(): void
{
$service = $this->createService();
$bookingDto = $this->createBookingDto();
$bookingDto->travel->rooms[12] = $this->createRoom(12, null);
$bookingDto->currentStep = 1;
$bookingDto->roomSelections = [
$this->createRoomSelection(10, 1),
$this->createRoomSelection(12, 2),
];
$summary = $service->getSummaryData($bookingDto);
// 1×2 for the known room; the room without occupancy contributes nothing.
$this->assertSame(2, $summary->participantCount);
}
private function createService(): BookingSummaryAssembler
{
$priceCalculator = $this->createStub(BookingPriceCalculator::class);
@@ -107,7 +124,7 @@ class BookingSummaryAssemblerTest extends TestCase
return new BookingDto($travel, 157047);
}
private function createRoom(int $id, int $maxPax): Room
private function createRoom(int $id, ?int $maxPax): Room
{
$room = new Room();
$room->id = $id;