feat: refactored accommodation booking status model
This commit is contained in:
@@ -94,10 +94,13 @@ class OfferControllerTest extends TestCase
|
||||
self::assertSame('groups/booking/offer_unavailable.html.twig', $controller->renderedView);
|
||||
}
|
||||
|
||||
public function testAccessRendersUnavailableForDraft(): void
|
||||
/**
|
||||
* @dataProvider statusesTheCustomerMustNotSee
|
||||
*/
|
||||
public function testAccessRendersUnavailableForABookingThatIsNotOfferedYet(AccommodationBookingStatus $status): void
|
||||
{
|
||||
$booking = new AccommodationBooking();
|
||||
$booking->setStatus(AccommodationBookingStatus::Draft);
|
||||
$booking->setStatus($status);
|
||||
|
||||
$bookingRepository = $this->createMock(AccommodationBookingRepository::class);
|
||||
$bookingRepository->method('findOneBy')->willReturn($booking);
|
||||
@@ -119,6 +122,18 @@ class OfferControllerTest extends TestCase
|
||||
self::assertSame('groups/booking/offer_unavailable.html.twig', $controller->renderedView);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<string, array{AccommodationBookingStatus}>
|
||||
*/
|
||||
public static function statusesTheCustomerMustNotSee(): iterable
|
||||
{
|
||||
// A scratch record and an inquiry the office has not worked through yet are both
|
||||
// unfinished; a discarded one is over. All three behave like an expired link.
|
||||
yield 'draft' => [AccommodationBookingStatus::Draft];
|
||||
yield 'requested' => [AccommodationBookingStatus::Requested];
|
||||
yield 'discarded' => [AccommodationBookingStatus::Discarded];
|
||||
}
|
||||
|
||||
public function testViewRendersUnavailableForDiscardedBooking(): void
|
||||
{
|
||||
$booking = new AccommodationBooking();
|
||||
|
||||
Reference in New Issue
Block a user