feat: derive calendar date range from price configurations
This commit is contained in:
@@ -19,6 +19,17 @@ class ContingentQueryTest extends TestCase
|
||||
self::assertSame('2026-01-01', $query->dateFromDate()->format('Y-m-d'));
|
||||
}
|
||||
|
||||
public function testCalendarQueryAcceptsAnOmittedRange(): void
|
||||
{
|
||||
$query = new ContingentCalendarQuery('HOTEL_1');
|
||||
|
||||
self::assertCount(0, $this->validator()->validate($query));
|
||||
|
||||
// Null is what puts the endpoint into full-span mode; there is no separate predicate for it.
|
||||
self::assertNull($query->dateFromDate());
|
||||
self::assertNull($query->dateToDate());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider invalidCalendarQueries
|
||||
*/
|
||||
@@ -33,6 +44,8 @@ class ContingentQueryTest extends TestCase
|
||||
yield 'reversed range' => [new ContingentCalendarQuery('HOTEL', '2026-03-02', '2026-03-01')];
|
||||
yield 'range over 366 days' => [new ContingentCalendarQuery('HOTEL', '2026-01-01', '2027-01-03')];
|
||||
yield 'invalid hotel code' => [new ContingentCalendarQuery('HOTEL CODE', '2026-01-01', '2026-01-02')];
|
||||
yield 'dateFrom without dateTo' => [new ContingentCalendarQuery('HOTEL', '2026-01-01')];
|
||||
yield 'dateTo without dateFrom' => [new ContingentCalendarQuery('HOTEL', null, '2026-01-02')];
|
||||
}
|
||||
|
||||
public function testPricesQueryRequiresFourDigitYear(): void
|
||||
|
||||
Reference in New Issue
Block a user