feat: upgrade phpunit to 12.5

This commit is contained in:
Björn Fromme committed 2026-08-31 09:03:44 +02:00
1 parent 010cfe56b2
commit 5396cbb548
95 files changed
+1435 -1224

No files matched your search

@@ -8,6 +8,7 @@ use App\Controller\Admin\AccommodationBooking\GenerateAccessLinkController;
use App\Entity\Groups\AccommodationBooking;
use App\Enum\Groups\AccommodationBookingStatus;
use App\Service\AccommodationBookingService;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -25,7 +26,7 @@ class GenerateAccessLinkControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('generateAccessLink');
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($this->requestedBooking(), Request::create('/admin/accommodation-booking/1/generate-access-link'));
@@ -33,9 +34,7 @@ class GenerateAccessLinkControllerTest extends TestCase
self::assertSame('admin/accommodation_booking/modal_generate_access_link.html.twig', $controller->renderedView);
}
/**
* @dataProvider statusesAwaitingAnOffer
*/
#[DataProvider('statusesAwaitingAnOffer')]
public function testPostGeneratesTheLinkAndRedirectsTheBrowser(AccommodationBookingStatus $status): void
{
$booking = $this->requestedBooking();
@@ -44,7 +43,7 @@ class GenerateAccessLinkControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::once())->method('generateAccessLink')->with($booking);
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/generate-access-link', 'POST'));
@@ -60,9 +59,7 @@ class GenerateAccessLinkControllerTest extends TestCase
yield 'requested' => [AccommodationBookingStatus::Requested];
}
/**
* @dataProvider statusesPastTheOffer
*/
#[DataProvider('statusesPastTheOffer')]
public function testABookingThatIsNotAwaitingAnOfferGetsNoLink(AccommodationBookingStatus $status): void
{
$booking = $this->requestedBooking();
@@ -71,7 +68,7 @@ class GenerateAccessLinkControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('generateAccessLink');
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/generate-access-link', 'POST'));
@@ -94,7 +91,7 @@ class GenerateAccessLinkControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('generateAccessLink');
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createMock(LoggerInterface::class), tokenValid: false);
$controller = new TestableGenerateAccessLinkController($bookingService, $this->createStub(LoggerInterface::class), tokenValid: false);
$this->expectException(AccessDeniedException::class);