fix: restore room occupancy lost to case-sensitive xml attribute lookup
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user