feat: upgrade phpunit to 12.5
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Entity\Groups\AccommodationBooking;
|
||||
use App\Enum\Groups\AccommodationBookingStatus;
|
||||
use App\Message\CreateClickUpBookingTaskMessage;
|
||||
use App\Service\AccommodationBookingService;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -29,7 +30,7 @@ class ConfirmControllerTest extends TestCase
|
||||
$bookingService = $this->createMock(AccommodationBookingService::class);
|
||||
$bookingService->expects(self::never())->method('confirmBooking');
|
||||
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createMock(LoggerInterface::class));
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createStub(LoggerInterface::class));
|
||||
|
||||
$response = $controller->index($this->receivedBooking(), Request::create('/admin/accommodation-booking/1/confirm'));
|
||||
|
||||
@@ -51,7 +52,7 @@ class ConfirmControllerTest extends TestCase
|
||||
->with(self::isInstanceOf(CreateClickUpBookingTaskMessage::class))
|
||||
->willReturnCallback(static fn (object $message): Envelope => new Envelope($message));
|
||||
|
||||
$controller = new TestableConfirmController($bookingService, $messageBus, $this->createMock(LoggerInterface::class));
|
||||
$controller = new TestableConfirmController($bookingService, $messageBus, $this->createStub(LoggerInterface::class));
|
||||
|
||||
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/confirm', 'POST'));
|
||||
|
||||
@@ -63,16 +64,14 @@ class ConfirmControllerTest extends TestCase
|
||||
$bookingService = $this->createMock(AccommodationBookingService::class);
|
||||
$bookingService->expects(self::never())->method('confirmBooking');
|
||||
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createMock(LoggerInterface::class), tokenValid: false);
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createStub(LoggerInterface::class), tokenValid: false);
|
||||
|
||||
$this->expectException(AccessDeniedException::class);
|
||||
|
||||
$controller->index($this->receivedBooking(), Request::create('/admin/accommodation-booking/1/confirm', 'POST'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider nonReceivedStatuses
|
||||
*/
|
||||
#[DataProvider('nonReceivedStatuses')]
|
||||
public function testABookingThatIsNotAwaitingValidationCannotBeConfirmed(AccommodationBookingStatus $status): void
|
||||
{
|
||||
$booking = $this->receivedBooking();
|
||||
@@ -81,7 +80,7 @@ class ConfirmControllerTest extends TestCase
|
||||
$bookingService = $this->createMock(AccommodationBookingService::class);
|
||||
$bookingService->expects(self::never())->method('confirmBooking');
|
||||
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createMock(LoggerInterface::class));
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createStub(LoggerInterface::class));
|
||||
|
||||
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/confirm', 'POST'));
|
||||
|
||||
@@ -108,7 +107,7 @@ class ConfirmControllerTest extends TestCase
|
||||
$bookingService = $this->createMock(AccommodationBookingService::class);
|
||||
$bookingService->expects(self::never())->method('confirmBooking');
|
||||
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createMock(LoggerInterface::class));
|
||||
$controller = new TestableConfirmController($bookingService, $this->neverDispatchingBus(), $this->createStub(LoggerInterface::class));
|
||||
|
||||
$response = $controller->index($booking, Request::create('/admin/accommodation-booking/1/confirm', 'POST'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user