feat: upgrade phpunit to 12.5

This commit is contained in:
Björn Fromme
2026-08-31 09:31:00 +02:00
parent 010cfe56b2
commit bfad61f1dd
95 changed files with 1436 additions and 1224 deletions
@@ -24,6 +24,7 @@ use App\Service\BookingEditDraftManager;
use App\Service\BookingEditPreFlightChecker;
use App\Service\BookingEditSubmitter;
use App\Service\BookingSessionManager;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\Form\FormInterface;
@@ -62,7 +63,7 @@ class IndexControllerTest extends TestCase
];
$bookingData = $this->createBooking();
$form = $this->createMock(FormInterface::class);
$form = $this->createStub(FormInterface::class);
$form->method('isSubmitted')->willReturn(false);
$fingerprintService = $this->createMock(BookingChangeTracker::class);
@@ -110,13 +111,13 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createStub(BookingEditDraftManager::class),
$bookingSessionService,
$fingerprintService,
$bookingConfigurator,
$contextFactory,
$preflightChecker,
$this->createMock(BookingEditSubmitter::class),
$this->createStub(BookingEditSubmitter::class),
$user,
$form,
);
@@ -147,7 +148,7 @@ class IndexControllerTest extends TestCase
];
$bookingData = $this->createBooking();
$form = $this->createMock(FormInterface::class);
$form = $this->createStub(FormInterface::class);
$form->method('isSubmitted')->willReturn(false);
$fingerprintService = $this->createMock(BookingChangeTracker::class);
@@ -187,13 +188,13 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$this->createMock(BookingConfigurator::class),
$this->createStub(BookingConfigurator::class),
$contextFactory,
$preflightChecker,
$this->createMock(BookingEditSubmitter::class),
$this->createStub(BookingEditSubmitter::class),
$user,
$form,
);
@@ -275,10 +276,10 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$this->createMock(BookingConfigurator::class),
$this->createStub(BookingConfigurator::class),
$contextFactory,
$preflightChecker,
$submitter,
@@ -362,10 +363,10 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$this->createMock(BookingConfigurator::class),
$this->createStub(BookingConfigurator::class),
$contextFactory,
$preflightChecker,
$submitter,
@@ -390,7 +391,7 @@ class IndexControllerTest extends TestCase
$bookingDto->participants = [$this->createParticipant()];
$bookingData = $this->createBooking();
$form = $this->createMock(FormInterface::class);
$form = $this->createStub(FormInterface::class);
$form->method('isSubmitted')->willReturn(false);
$fingerprintService = $this->createMock(BookingChangeTracker::class);
@@ -433,13 +434,13 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$bookingConfigurator,
$contextFactory,
$this->createPreflightChecker($bookingDto),
$this->createMock(BookingEditSubmitter::class),
$this->createStub(BookingEditSubmitter::class),
$user,
$form,
);
@@ -460,7 +461,7 @@ class IndexControllerTest extends TestCase
$bookingDto->participants = [$this->createParticipant()];
$bookingData = $this->createBooking();
$form = $this->createMock(FormInterface::class);
$form = $this->createStub(FormInterface::class);
$form->method('isSubmitted')->willReturn(false);
$fingerprintService = $this->createMock(BookingChangeTracker::class);
@@ -501,13 +502,13 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$bookingConfigurator,
$contextFactory,
$this->createPreflightChecker($bookingDto),
$this->createMock(BookingEditSubmitter::class),
$this->createStub(BookingEditSubmitter::class),
$user,
$form,
);
@@ -543,13 +544,13 @@ class IndexControllerTest extends TestCase
$dataLoader,
$draftService,
$bookingSessionService,
$this->createMock(BookingChangeTracker::class),
$this->createMock(BookingConfigurator::class),
$this->createMock(BookingEditContextFactory::class),
$this->createMock(BookingEditPreFlightChecker::class),
$this->createMock(BookingEditSubmitter::class),
$this->createStub(BookingChangeTracker::class),
$this->createStub(BookingConfigurator::class),
$this->createStub(BookingEditContextFactory::class),
$this->createStub(BookingEditPreFlightChecker::class),
$this->createStub(BookingEditSubmitter::class),
$user,
$this->createMock(FormInterface::class),
$this->createStub(FormInterface::class),
);
$response = $controller->reloadFromApi(42, $request);
@@ -560,11 +561,11 @@ class IndexControllerTest extends TestCase
}
/**
* @dataProvider submissionResultProvider
*
* @param array<int, array{0: string, 1: string}> $expectedFlashes
*
* @phpstan-param array<int, array{0: string, 1: string}> $expectedFlashes
*/
#[DataProvider('submissionResultProvider')]
public function testIndexAppliesErrorSubmissionResultFlashesAndRedirectsBackToEditPage(
BookingEditSubmissionResult $submissionResult,
array $expectedFlashes,
@@ -673,7 +674,7 @@ class IndexControllerTest extends TestCase
bookingDto: $bookingDto,
bookingData: $bookingData,
mutableData: null,
summaryData: $this->createMock(BookingSummaryDto::class),
summaryData: $this->createStub(BookingSummaryDto::class),
cardsData: [
0 => new ParticipantCardDataDto(
'One',
@@ -755,11 +756,11 @@ class IndexControllerTest extends TestCase
$controller = new TestableIndexController(
$dataLoader,
$this->createMock(BookingEditDraftManager::class),
$this->createMock(BookingSessionManager::class),
$this->createStub(BookingEditDraftManager::class),
$this->createStub(BookingSessionManager::class),
$fingerprintService,
$this->createMock(BookingConfigurator::class),
$this->createMock(BookingEditContextFactory::class),
$this->createStub(BookingConfigurator::class),
$this->createStub(BookingEditContextFactory::class),
$preflightChecker,
$submitter,
$user,