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