feat: api endpoints and xml sync for contingents data

This commit is contained in:
Björn Fromme
2026-04-22 11:23:52 +02:00
parent a1f68ec11d
commit 9b84893d88
50 changed files with 2567 additions and 221 deletions
@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace BusProNet\Utility;
use App\BusProNet\Utility\BookingUrlUtility;
use PHPUnit\Framework\TestCase;
class BookingUrlUtilityTest extends TestCase
{
public function testBuildUsesConfiguredDefaultBaseUrlAsAbsoluteFallback(): void
{
$utility = new BookingUrlUtility('https://my.ep-reisen.de');
$url = $utility->build(157047, 11606);
$this->assertSame(
'https://my.ep-reisen.de/bookings/create?date_id=11606&hotel_id=157047',
$url
);
}
public function testBuildUsesCustomBaseUrlWhenProvided(): void
{
$utility = new BookingUrlUtility('https://my.ep-reisen.de');
$url = $utility->build(157047, 11606, 'https://my.example.test/');
$this->assertSame(
'https://my.example.test/bookings/create?date_id=11606&hotel_id=157047',
$url
);
}
public function testBuildFallsBackToConfiguredDefaultWhenCustomBaseIsBlank(): void
{
$utility = new BookingUrlUtility('https://fallback.test');
$url = $utility->build(157047, 11606, ' ');
$this->assertSame(
'https://fallback.test/bookings/create?date_id=11606&hotel_id=157047',
$url
);
}
public function testBuildReturnsRelativeUrlWhenNoBaseUrlAvailable(): void
{
$utility = new BookingUrlUtility('');
$url = $utility->build(157047, 11606);
$this->assertSame('/bookings/create?date_id=11606&hotel_id=157047', $url);
}
}