fix: refresh live room availability during create flow

This commit is contained in:
Björn Fromme committed 2026-07-14 11:25:23 +02:00
1 parent a73e8a593f
commit cdce7d57e0
26 files changed
+1976 -54

No files matched your search

@@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
namespace App\Tests\Controller\Api;
use App\BusProNet\ApiClient;
use App\BusProNet\Model\BaseData;
use App\BusProNet\Model\Notification;
use App\BusProNet\Model\Room;
use App\Controller\Api\TravelController;
use App\Service\TravelDataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
class TravelControllerTest extends TestCase
{
public function testHotelAvailabilityOnlySerializesApiGroupFields(): void
{
$room = new Room();
$room->id = 1;
$room->label = 'Doppelzimmer';
$room->status = 'Frei';
$room->available = 2;
$room->price = 199.0;
// booking-only fields that must NOT appear in the API response
$room->dateFrom = new \DateTimeImmutable('2030-01-01');
$room->totalCount = 42;
$room->board = 'Halbpension';
$apiClient = $this->createMock(ApiClient::class);
$apiClient->expects($this->once())
->method('getHotelAvailability')
->willReturn(new BaseData([1 => $room]));
$controller = new TravelController($apiClient, $this->createMock(TravelDataProvider::class));
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
$serializer = new Serializer(
[new DateTimeNormalizer(), new ObjectNormalizer($classMetadataFactory)],
[new JsonEncoder()],
);
$container = new Container();
$container->set('serializer', $serializer);
$controller->setContainer($container);
$response = $controller->hotelAvailability(12345, 67890, new \DateTimeImmutable('2030-01-06'));
$payload = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$roomPayload = $payload['1'] ?? null;
$this->assertNotNull($roomPayload);
$this->assertSame('Frei', $roomPayload['status']);
$this->assertArrayNotHasKey('dateFrom', $roomPayload);
$this->assertArrayNotHasKey('totalCount', $roomPayload);
$this->assertArrayNotHasKey('board', $roomPayload);
}
public function testHotelAvailabilityReturnsErrorPayloadForApiNotification(): void
{
$apiClient = $this->createMock(ApiClient::class);
$apiClient->expects($this->once())
->method('getHotelAvailability')
->willReturn(new Notification(999, 'Hotel not found'));
$controller = new TravelController($apiClient, $this->createMock(TravelDataProvider::class));
$container = new Container();
$container->set('serializer', new Serializer(
[new ObjectNormalizer(new ClassMetadataFactory(new AttributeLoader()))],
[new JsonEncoder()],
));
$controller->setContainer($container);
$response = $controller->hotelAvailability(12345, 67890, new \DateTimeImmutable('2030-01-06'));
$payload = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR);
$this->assertSame(['error' => 'Hotel not found', 'type' => 'api_error'], $payload);
}
}
@@ -0,0 +1,242 @@
<?php
declare(strict_types=1);
namespace App\Tests\Controller\Booking\Create;
use App\BusProNet\Model\Room;
use App\BusProNet\Model\Travel;
use App\Controller\Booking\Create\Step1Controller;
use App\Form\Model\BookingCreateContext;
use App\Form\Model\BookingDto;
use App\Form\Model\BookingSummaryDto;
use App\Form\Model\RoomGroupsDto;
use App\Form\Model\RoomSelectionDto;
use App\Service\BookingAvailabilityRefreshResult;
use App\Service\BookingConfigurator;
use App\Service\BookingCreateContextFactory;
use App\Service\BookingSessionManager;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
class Step1ControllerTest extends TestCase
{
public function testIndexRefreshesBaselineAfterAutoPruningUnavailableRooms(): void
{
$request = Request::create('/bookings/create/rooms', 'GET');
$bookingDto = $this->createBookingDtoWithUnavailableSelection();
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getOrCreateBookingCreateDto')
->with($request)
->willReturn($bookingDto);
$bookingSessionService->expects($this->once())
->method('getOrCreateBaselineSnapshot')
->with($request, $bookingDto)
->willReturn([[2, 1]]);
$bookingSessionService->expects($this->once())
->method('refreshCreateAvailability')
->with($request, $bookingDto)
->willReturn(new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: true,
roomSelectionSnapshotChanged: true,
hasAvailableRooms: true,
));
$bookingSessionService->expects($this->once())
->method('saveBaselineSnapshot')
->with($request, $bookingDto);
$bookingService = $this->createMock(BookingConfigurator::class);
$form = $this->createMock(FormInterface::class);
$form->expects($this->once())
->method('handleRequest')
->with($request)
->willReturnSelf();
$form->expects($this->once())
->method('isSubmitted')
->willReturn(false);
$createContextFactory = $this->createMock(BookingCreateContextFactory::class);
$createContextFactory->expects($this->once())
->method('create')
->with($bookingDto, $this->anything())
->willReturn(new BookingCreateContext(
bookingDto: $bookingDto,
summaryData: $this->createMock(BookingSummaryDto::class),
groupedRooms: new RoomGroupsDto([], []),
));
$controller = new TestableStep1Controller(
$bookingService,
$bookingSessionService,
$createContextFactory,
$form,
);
$response = $controller->index($request);
$this->assertInstanceOf(Response::class, $response);
$this->assertSame(['warning', 'Mindestens eine Zimmerauswahl ist nicht mehr verfügbar und wurde zurückgesetzt.'], $controller->flashes[0]);
}
public function testIndexUsesPrunedBaselineBeforeSubmittingUnchangedSelections(): void
{
$request = Request::create('/bookings/create/rooms', 'POST');
$bookingDto = $this->createBookingDtoWithUnavailableSelection();
$bookingDto = $this->getMockBuilder(BookingDto::class)
->setConstructorArgs([$bookingDto->travel, $bookingDto->hotelId])
->onlyMethods(['hasRoomSelectionChanged', 'resetParticipantAssignments'])
->getMock();
$bookingDto->roomSelections = $this->createBookingDtoWithUnavailableSelection()->roomSelections;
$bookingDto->currentStep = 1;
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getOrCreateBookingCreateDto')
->with($request)
->willReturn($bookingDto);
$bookingSessionService->expects($this->once())
->method('getOrCreateBaselineSnapshot')
->with($request, $bookingDto)
->willReturn([[1, 0], [2, 1]]);
$bookingSessionService->expects($this->once())
->method('refreshCreateAvailability')
->with($request, $bookingDto)
->willReturn(new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: true,
roomSelectionSnapshotChanged: true,
hasAvailableRooms: true,
));
$bookingSessionService->expects($this->once())
->method('saveBookingDto')
->with($request, $bookingDto, BookingDto::MODE_CREATE);
$bookingSessionService->expects($this->once())
->method('saveBaselineSnapshot')
->with($request, $bookingDto)
->willReturn([[1, 0]]);
$bookingSessionService->expects($this->once())
->method('clearBaselineSnapshot')
->with($request);
$bookingService = $this->createMock(BookingConfigurator::class);
$bookingService->expects($this->once())
->method('updateBookingStatusFromRoomSelection')
->with($bookingDto);
$bookingDto->expects($this->never())
->method('resetParticipantAssignments');
$bookingDto->expects($this->once())
->method('hasRoomSelectionChanged')
->with([[1, 0]])
->willReturn(false);
$form = $this->createMock(FormInterface::class);
$form->expects($this->once())
->method('handleRequest')
->with($request)
->willReturnSelf();
$form->expects($this->once())
->method('isSubmitted')
->willReturn(true);
$form->expects($this->once())
->method('isValid')
->willReturn(true);
$createContextFactory = $this->createMock(BookingCreateContextFactory::class);
$createContextFactory->expects($this->never())
->method('create');
$controller = new TestableStep1Controller(
$bookingService,
$bookingSessionService,
$createContextFactory,
$form,
);
$response = $controller->index($request);
$this->assertInstanceOf(Response::class, $response);
}
private function createBookingDtoWithUnavailableSelection(): BookingDto
{
$travel = new Travel();
$travel->id = 1234;
$availableRoom = new Room();
$availableRoom->id = 1;
$availableRoom->label = 'Doppelzimmer';
$availableRoom->available = 2;
$availableRoom->status = 'Frei';
$travel->rooms = [$availableRoom];
$bookingDto = new BookingDto($travel, 77);
$selection = new RoomSelectionDto();
$selection->id = 2;
$selection->quantity = 1;
$bookingDto->roomSelections = [$selection];
return $bookingDto;
}
}
final class TestableStep1Controller extends Step1Controller
{
/**
* @var array<int, array{string, mixed}>
*/
public array $flashes = [];
/**
* @param FormInterface<mixed> $form
*/
public function __construct(
BookingConfigurator $bookingService,
BookingSessionManager $bookingSessionService,
BookingCreateContextFactory $createContextFactory,
private readonly FormInterface $form,
) {
parent::__construct($bookingService, $bookingSessionService, $createContextFactory);
}
/**
* @return FormInterface<mixed>
*/
protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface
{
return $this->form;
}
protected function addFlash(string $type, mixed $message): void
{
$this->flashes[] = [$type, $message];
}
/**
* @param array<string, mixed> $parameters
*/
protected function render(string $view, array $parameters = [], ?Response $response = null): Response
{
return new Response('rendered:'.$view);
}
protected function redirectToRoute(string $route, array $parameters = [], int $status = 302): RedirectResponse
{
return new RedirectResponse('redirect:'.$route, $status);
}
protected function generateUrl(string $route, array $parameters = [], int $referenceType = 0): string
{
return $route;
}
}
@@ -0,0 +1,199 @@
<?php
declare(strict_types=1);
namespace App\Tests\Controller\Booking\Create;
use App\BusProNet\Model\Room;
use App\BusProNet\Model\Travel;
use App\Controller\Booking\Create\Step2ParticipantController;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Form\Model\RoomSelectionDto;
use App\Htmx\HxRedirectResponse;
use App\Service\BookingAvailabilityRefreshResult;
use App\Service\BookingConfigurator;
use App\Service\BookingCreateContextFactory;
use App\Service\BookingSessionManager;
use App\Service\ParticipantDataPrefiller;
use App\Service\ParticipantFormSupport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
class Step2ParticipantControllerTest extends TestCase
{
public function testEditParticipantPersistsBookingStatusOnPlainGetRequest(): void
{
$request = Request::create('/bookings/create/participants/0', 'GET');
$bookingDto = $this->createBookingDto();
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getBookingDto')
->with($request, BookingDto::MODE_CREATE)
->willReturn($bookingDto);
$bookingSessionService->expects($this->once())
->method('refreshCreateAvailability')
->with($request, $bookingDto, false)
->willReturn(new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: false,
roomSelectionSnapshotChanged: false,
hasAvailableRooms: true,
));
$bookingSessionService->expects($this->once())
->method('saveBookingDto')
->with($request, $bookingDto, BookingDto::MODE_CREATE);
$bookingService = $this->createMock(BookingConfigurator::class);
$bookingService->expects($this->once())
->method('updateBookingStatusFromRoomSelection')
->with($bookingDto);
$participantFormSupportService = $this->createMock(ParticipantFormSupport::class);
$participantFormSupportService->method('ensureParticipantExists')->willReturn(new ParticipantDto());
$participantFormSupportService->method('createParticipantEditDto')->willReturn($this->createMock(\App\Form\Model\ParticipantEditDto::class));
$participantFormSupportService->method('getParticipantFormOptions')->willReturn([]);
$participantFormSupportService->method('collectAndClearNotifications')->willReturn([]);
$prepopulationService = $this->createMock(ParticipantDataPrefiller::class);
$prepopulationService->method('isDummyDataFillRequested')->willReturn(false);
$form = $this->createMock(FormInterface::class);
$form->expects($this->once())->method('handleRequest')->with($request)->willReturnSelf();
$form->expects($this->once())->method('isSubmitted')->willReturn(false);
$bookingDto->participants[0] = new ParticipantDto();
$createContextFactory = $this->createMock(BookingCreateContextFactory::class);
$createContextFactory->method('create')->willReturn(new \App\Form\Model\BookingCreateContext(
bookingDto: $bookingDto,
summaryData: $this->createMock(\App\Form\Model\BookingSummaryDto::class),
groupedRooms: new \App\Form\Model\RoomGroupsDto([], []),
));
$controller = new TestableStep2ParticipantController(
$bookingService,
$bookingSessionService,
$createContextFactory,
$prepopulationService,
$participantFormSupportService,
);
$controller->form = $form;
$response = $controller->editParticipant(0, $request);
$this->assertSame('rendered', $response->getContent());
}
public function testRefreshParticipantFormReturnsHxRedirectForHtmxRequestWhenSelectionStale(): void
{
$request = Request::create('/bookings/create/participants/0/refresh', 'POST');
$request->headers->set('HX-Request', 'true');
$response = $this->invokeRefreshWithStaleSelection($request);
$this->assertInstanceOf(HxRedirectResponse::class, $response);
$this->assertSame('app_booking_create_step_1', $response->headers->get('HX-Redirect'));
}
public function testRefreshParticipantFormReturnsPlainRedirectForNonHtmxRequestWhenSelectionStale(): void
{
$request = Request::create('/bookings/create/participants/0/refresh', 'POST');
$response = $this->invokeRefreshWithStaleSelection($request);
$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertNotInstanceOf(HxRedirectResponse::class, $response);
$this->assertSame('app_booking_create_step_1', $response->getTargetUrl());
}
private function invokeRefreshWithStaleSelection(Request $request): \Symfony\Component\HttpFoundation\Response
{
$bookingDto = $this->createBookingDto();
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getBookingDto')
->with($request, BookingDto::MODE_CREATE)
->willReturn($bookingDto);
$bookingSessionService->expects($this->once())
->method('refreshCreateAvailability')
->with($request, $bookingDto, false)
->willReturn(new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: true,
roomSelectionSnapshotChanged: true,
hasAvailableRooms: true,
));
$bookingService = $this->createMock(BookingConfigurator::class);
$bookingService->expects($this->never())->method('updateBookingStatusFromRoomSelection');
$controller = new TestableStep2ParticipantController(
$bookingService,
$bookingSessionService,
$this->createMock(BookingCreateContextFactory::class),
$this->createMock(ParticipantDataPrefiller::class),
$this->createMock(ParticipantFormSupport::class),
);
return $controller->refreshParticipantForm(0, $request);
}
private function createBookingDto(): BookingDto
{
$travel = new Travel();
$travel->id = 1234;
$travel->hotelId = 77;
$room = new Room();
$room->id = 1;
$room->label = 'Doppelzimmer';
$room->available = 2;
$room->status = 'Frei';
$travel->rooms = [$room];
$bookingDto = new BookingDto($travel, 77);
$bookingDto->currentStep = 2;
$selection = new RoomSelectionDto();
$selection->id = 1;
$selection->quantity = 1;
$bookingDto->roomSelections = [$selection];
return $bookingDto;
}
}
final class TestableStep2ParticipantController extends Step2ParticipantController
{
/**
* @var array<int, array{string, mixed}>
*/
public array $flashes = [];
public ?FormInterface $form = null;
protected function addFlash(string $type, mixed $message): void
{
$this->flashes[] = [$type, $message];
}
protected function generateUrl(string $route, array $parameters = [], int $referenceType = 0): string
{
return $route;
}
protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface
{
return $this->form;
}
protected function render(string $view, array $parameters = [], ?\Symfony\Component\HttpFoundation\Response $response = null): \Symfony\Component\HttpFoundation\Response
{
return new \Symfony\Component\HttpFoundation\Response('rendered');
}
}
@@ -0,0 +1,239 @@
<?php
declare(strict_types=1);
namespace App\Tests\Controller\Booking\Create;
use App\BusProNet\ApiClient;
use App\BusProNet\Model\Room;
use App\BusProNet\Model\Travel;
use App\Controller\Booking\Create\Step4Controller;
use App\Form\Model\BookingCreateContext;
use App\Form\Model\BookingDto;
use App\Form\Model\BookingSummaryDto;
use App\Form\Model\RoomGroupsDto;
use App\Form\Model\RoomSelectionDto;
use App\Service\BookingAvailabilityRefreshResult;
use App\Service\BookingConfigurator;
use App\Service\BookingCreateContextFactory;
use App\Service\BookingSessionManager;
use App\Service\NewsletterManager;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\Cache\CacheInterface;
class Step4ControllerTest extends TestCase
{
public function testIndexRerendersWithErrorWhenForcedRefreshFails(): void
{
$request = Request::create('/bookings/create/confirmation', 'POST');
$bookingDto = $this->createBookingDto();
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getOrCreateBookingCreateDto')
->with($request)
->willReturn($bookingDto);
$bookingSessionService->expects($this->exactly(2))
->method('refreshCreateAvailability')
->willReturnOnConsecutiveCalls(
new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: false,
roomSelectionSnapshotChanged: false,
hasAvailableRooms: true,
),
new BookingAvailabilityRefreshResult(
availabilityRefreshed: false,
roomSelectionQuantityReset: false,
roomSelectionSnapshotChanged: false,
hasAvailableRooms: true,
),
);
$bookingService = $this->createMock(BookingConfigurator::class);
$bookingService->expects($this->never())->method('applyCreateBookingStatusRules');
$apiClient = $this->createMock(ApiClient::class);
$apiClient->expects($this->never())->method('createBooking');
$form = $this->createMock(FormInterface::class);
$form->expects($this->once())->method('handleRequest')->with($request)->willReturnSelf();
$form->expects($this->once())->method('isSubmitted')->willReturn(true);
$form->expects($this->once())->method('isValid')->willReturn(true);
$createContextFactory = $this->createMock(BookingCreateContextFactory::class);
$createContextFactory->expects($this->once())
->method('createWithParticipantPrices')
->with($bookingDto)
->willReturn(new BookingCreateContext(
bookingDto: $bookingDto,
summaryData: $this->createMock(BookingSummaryDto::class),
groupedRooms: new RoomGroupsDto([], []),
));
$controller = new TestableStep4Controller(
$bookingService,
$bookingSessionService,
$createContextFactory,
$apiClient,
$this->createMock(CacheInterface::class),
$this->createMock(NewsletterManager::class),
new NullLogger(),
$form,
);
$response = $controller->index($request);
$this->assertInstanceOf(Response::class, $response);
$this->assertNotInstanceOf(RedirectResponse::class, $response);
$this->assertSame('rendered:booking/create/step_4.html.twig', $response->getContent());
$this->assertSame(['error', 'Die Verfügbarkeit konnte gerade nicht aktualisiert werden. Bitte versuche es erneut.'], $controller->flashes[0]);
}
public function testIndexRedirectsWithWarningWhenPriceChangesDuringForcedRefresh(): void
{
$request = Request::create('/bookings/create/confirmation', 'POST');
$bookingDto = $this->createBookingDto();
$bookingSessionService = $this->createMock(BookingSessionManager::class);
$bookingSessionService->expects($this->once())
->method('getOrCreateBookingCreateDto')
->with($request)
->willReturn($bookingDto);
$bookingSessionService->expects($this->exactly(2))
->method('refreshCreateAvailability')
->willReturnOnConsecutiveCalls(
new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: false,
roomSelectionSnapshotChanged: false,
hasAvailableRooms: true,
),
new BookingAvailabilityRefreshResult(
availabilityRefreshed: true,
roomSelectionQuantityReset: false,
roomSelectionSnapshotChanged: true,
hasAvailableRooms: true,
),
);
$bookingService = $this->createMock(BookingConfigurator::class);
$bookingService->expects($this->never())->method('applyCreateBookingStatusRules');
$apiClient = $this->createMock(ApiClient::class);
$apiClient->expects($this->never())->method('createBooking');
$form = $this->createMock(FormInterface::class);
$form->expects($this->once())->method('handleRequest')->with($request)->willReturnSelf();
$form->expects($this->once())->method('isSubmitted')->willReturn(true);
$form->expects($this->once())->method('isValid')->willReturn(true);
$createContextFactory = $this->createMock(BookingCreateContextFactory::class);
$createContextFactory->expects($this->never())->method('createWithParticipantPrices');
$controller = new TestableStep4Controller(
$bookingService,
$bookingSessionService,
$createContextFactory,
$apiClient,
$this->createMock(CacheInterface::class),
$this->createMock(NewsletterManager::class),
new NullLogger(),
$form,
);
$response = $controller->index($request);
$this->assertInstanceOf(RedirectResponse::class, $response);
$this->assertSame('app_booking_create_step_4', $response->getTargetUrl());
$this->assertSame(['warning', 'Die Zimmerpreise haben sich aktualisiert. Bitte überprüfe deine Buchung erneut.'], $controller->flashes[0]);
}
private function createBookingDto(): BookingDto
{
$travel = new Travel();
$travel->id = 1234;
$travel->hotelId = 77;
$room = new Room();
$room->id = 1;
$room->label = 'Doppelzimmer';
$room->available = 2;
$room->status = 'Frei';
$travel->rooms = [$room];
$bookingDto = new BookingDto($travel, 77);
$bookingDto->currentStep = 4;
$selection = new RoomSelectionDto();
$selection->id = 1;
$selection->quantity = 1;
$bookingDto->roomSelections = [$selection];
return $bookingDto;
}
}
final class TestableStep4Controller extends Step4Controller
{
/**
* @var array<int, array{string, mixed}>
*/
public array $flashes = [];
public function __construct(
BookingConfigurator $bookingService,
BookingSessionManager $bookingSessionService,
BookingCreateContextFactory $createContextFactory,
ApiClient $apiClient,
CacheInterface $cache,
NewsletterManager $doubleOptInService,
\Psr\Log\LoggerInterface $logger,
private readonly FormInterface $form,
) {
parent::__construct(
$bookingService,
$bookingSessionService,
$createContextFactory,
$apiClient,
$cache,
$doubleOptInService,
$logger,
);
}
protected function createForm(string $type, mixed $data = null, array $options = []): FormInterface
{
return $this->form;
}
protected function addFlash(string $type, mixed $message): void
{
$this->flashes[] = [$type, $message];
}
protected function render(string $view, array $parameters = [], ?Response $response = null): Response
{
return new Response('rendered:'.$view);
}
protected function redirectToRoute(string $route, array $parameters = [], int $status = 302): RedirectResponse
{
return new RedirectResponse($route, $status);
}
protected function generateUrl(string $route, array $parameters = [], int $referenceType = 0): string
{
return $route;
}
protected function getUser(): ?\Symfony\Component\Security\Core\User\UserInterface
{
return null;
}
}