feat: extract booking session handling

This commit is contained in:
Björn Fromme
2026-04-11 18:28:32 +02:00
parent ca052682bb
commit 8b72f8c277
21 changed files with 485 additions and 330 deletions
@@ -13,6 +13,7 @@ use App\BusProNet\XmlLoader\AgencyLoader;
use App\Exception\NoRoomsAvailableException;
use App\Service\BookingPriceCalculatorService;
use App\Service\BookingService;
use App\Service\BookingSessionService;
use App\Service\ParticipantEligibilityService;
use App\Service\TravelDataService;
use PHPUnit\Framework\TestCase;
@@ -27,6 +28,7 @@ class BookingServiceStatusTest extends TestCase
protected function setUp(): void
{
$bookingSessionService = $this->createMock(BookingSessionService::class);
$this->travelDataService = $this->createMock(TravelDataService::class);
$priceCalculator = $this->createMock(BookingPriceCalculatorService::class);
$participantEligibility = $this->createMock(ParticipantEligibilityService::class);
@@ -35,6 +37,7 @@ class BookingServiceStatusTest extends TestCase
$agencyLoader = $this->createMock(AgencyLoader::class);
$this->bookingService = new BookingService(
$bookingSessionService,
$this->travelDataService,
$priceCalculator,
$participantEligibility,
@@ -178,6 +181,7 @@ class BookingServiceStatusTest extends TestCase
$bookingStatusRuleRegistry->method('evaluateStatus')->willReturn('O');
$bookingService = new BookingService(
$this->createMock(BookingSessionService::class),
$this->travelDataService,
$this->createMock(BookingPriceCalculatorService::class),
$this->createMock(ParticipantEligibilityService::class),
@@ -209,6 +213,7 @@ class BookingServiceStatusTest extends TestCase
$bookingStatusRuleRegistry->expects($this->never())->method('evaluateStatus');
$bookingService = new BookingService(
$this->createMock(BookingSessionService::class),
$this->travelDataService,
$this->createMock(BookingPriceCalculatorService::class),
$this->createMock(ParticipantEligibilityService::class),