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
@@ -247,6 +247,31 @@ class RoomPricingCalculatorTest extends TestCase
$this->assertEquals(458.0, $result[0]['totalPrice']);
}
public function testCalculateRoomPricingFallsBackToOneParticipantWhenOccupancyIsUnknown(): void
{
$room = new Room();
$room->id = 4;
$room->price = 419.0;
$room->minPax = null;
$room->label = 'Bett im Mehrbettzimmer';
$travel = new Travel();
$travel->rooms = [$room];
$roomSelection = new RoomSelectionDto();
$roomSelection->id = 4;
$roomSelection->quantity = 2;
$bookingDto = new BookingDto($travel, 1);
$bookingDto->roomSelections = [$roomSelection];
$result = $this->calculator->calculateRoomPricing($bookingDto, RoomPricingCalculator::PRICING_MODE_SELECTION);
$this->assertCount(1, $result);
$this->assertEquals(2, $result[0]['participantCount']);
$this->assertEquals(838.0, $result[0]['totalPrice']);
}
public function testCalculateRoomPricingInEditModeUsesStoredIndividualPrices(): void
{
$travel = new Travel();