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
@@ -8,6 +8,7 @@ use App\Controller\Admin\AccommodationBooking\SendOfferController;
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 SendOfferControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendOffer');
$controller = new TestableSendOfferController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableSendOfferController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($this->requestedBooking(), Request::create('/admin/accommodation-booking/1/send-offer'));
@@ -33,9 +34,7 @@ class SendOfferControllerTest extends TestCase
self::assertSame('admin/accommodation_booking/modal_send_offer.html.twig', $controller->renderedView);
}
/**
* @dataProvider statusesAwaitingAnOffer
*/
#[DataProvider('statusesAwaitingAnOffer')]
public function testPostSendsTheOfferAndRedirectsTheBrowser(AccommodationBookingStatus $status): void
{
$booking = $this->requestedBooking();
@@ -44,7 +43,7 @@ class SendOfferControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::once())->method('sendOffer')->with($booking);
$controller = new TestableSendOfferController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableSendOfferController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/send-offer', 'POST'));
@@ -61,9 +60,7 @@ class SendOfferControllerTest extends TestCase
yield 'requested' => [AccommodationBookingStatus::Requested];
}
/**
* @dataProvider statusesPastTheOffer
*/
#[DataProvider('statusesPastTheOffer')]
public function testABookingThatIsNotAwaitingAnOfferGetsNone(AccommodationBookingStatus $status): void
{
$booking = $this->requestedBooking();
@@ -72,7 +69,7 @@ class SendOfferControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendOffer');
$controller = new TestableSendOfferController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableSendOfferController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/send-offer', 'POST'));
@@ -95,7 +92,7 @@ class SendOfferControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendOffer');
$controller = new TestableSendOfferController($bookingService, $this->createMock(LoggerInterface::class), tokenValid: false);
$controller = new TestableSendOfferController($bookingService, $this->createStub(LoggerInterface::class), tokenValid: false);
$this->expectException(AccessDeniedException::class);
@@ -113,7 +110,7 @@ class SendOfferControllerTest extends TestCase
$bookingService = $this->createMock(AccommodationBookingService::class);
$bookingService->expects(self::never())->method('sendOffer');
$controller = new TestableSendOfferController($bookingService, $this->createMock(LoggerInterface::class));
$controller = new TestableSendOfferController($bookingService, $this->createStub(LoggerInterface::class));
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/send-offer', 'POST'));