feat: upgrade phpunit to 12.5
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Entity\Groups\AccommodationBooking;
|
||||
use App\Message\CreateClickUpBookingTaskMessage;
|
||||
use App\MessageHandler\CreateClickUpBookingTaskHandler;
|
||||
use App\Repository\Groups\AccommodationBookingRepository;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
@@ -48,7 +49,7 @@ class CreateClickUpBookingTaskHandlerTest extends TestCase
|
||||
|
||||
public function testAVanishedBookingIsSkipped(): void
|
||||
{
|
||||
$repository = $this->createMock(AccommodationBookingRepository::class);
|
||||
$repository = $this->createStub(AccommodationBookingRepository::class);
|
||||
$repository->method('find')->willReturn(null);
|
||||
|
||||
$client = $this->createMock(ApiClient::class);
|
||||
@@ -58,15 +59,13 @@ class CreateClickUpBookingTaskHandlerTest extends TestCase
|
||||
$this->handler($repository, $client)(new CreateClickUpBookingTaskMessage(42));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider incompleteBookings
|
||||
*/
|
||||
#[DataProvider('incompleteBookings')]
|
||||
public function testABookingWithoutTheDataForATaskNameIsSkipped(callable $mutate): void
|
||||
{
|
||||
$booking = $this->booking();
|
||||
$mutate($booking);
|
||||
|
||||
$repository = $this->createMock(AccommodationBookingRepository::class);
|
||||
$repository = $this->createStub(AccommodationBookingRepository::class);
|
||||
$repository->method('find')->willReturn($booking);
|
||||
|
||||
$client = $this->createMock(ApiClient::class);
|
||||
@@ -94,10 +93,10 @@ class CreateClickUpBookingTaskHandlerTest extends TestCase
|
||||
|
||||
public function testAFailingStatusUpdateDoesNotRetryTheTaskCreation(): void
|
||||
{
|
||||
$repository = $this->createMock(AccommodationBookingRepository::class);
|
||||
$repository = $this->createStub(AccommodationBookingRepository::class);
|
||||
$repository->method('find')->willReturn($this->booking());
|
||||
|
||||
$client = $this->createMock(ApiClient::class);
|
||||
$client = $this->createStub(ApiClient::class);
|
||||
$client->method('isConfigured')->willReturn(true);
|
||||
$client->method('createTaskFromTemplate')->willReturn('abc123');
|
||||
$client->method('updateTaskStatus')->willThrowException(new ClickUpException('boom'));
|
||||
|
||||
@@ -81,7 +81,7 @@ class MailjetNewsletterEventHandlerTest extends TestCase
|
||||
$consent = new NewsletterConsent('[email protected]', 123);
|
||||
$consent->markRevoked(new \DateTimeImmutable('2026-04-29T11:00:00+00:00'));
|
||||
|
||||
$repository = $this->createMock(NewsletterConsentRepository::class);
|
||||
$repository = $this->createStub(NewsletterConsentRepository::class);
|
||||
$repository->method('findOneByEmailAndListId')->willReturn($consent);
|
||||
|
||||
$entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
@@ -103,7 +103,7 @@ class MailjetNewsletterEventHandlerTest extends TestCase
|
||||
$consent = new NewsletterConsent('[email protected]', 123);
|
||||
$consent->markConfirmed(new \DateTimeImmutable('2026-04-29T11:00:00+00:00'));
|
||||
|
||||
$repository = $this->createMock(NewsletterConsentRepository::class);
|
||||
$repository = $this->createStub(NewsletterConsentRepository::class);
|
||||
$repository->method('findOneByEmailAndListId')->willReturn($consent);
|
||||
|
||||
$entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
@@ -126,7 +126,7 @@ class MailjetNewsletterEventHandlerTest extends TestCase
|
||||
$consent = new NewsletterConsent('[email protected]', 123);
|
||||
$consent->markRevoked(new \DateTimeImmutable('2026-04-29T11:00:00+00:00'));
|
||||
|
||||
$repository = $this->createMock(NewsletterConsentRepository::class);
|
||||
$repository = $this->createStub(NewsletterConsentRepository::class);
|
||||
$repository->method('findOneByEmailAndListId')->willReturn($consent);
|
||||
|
||||
$entityManager = $this->createMock(EntityManagerInterface::class);
|
||||
|
||||
Reference in New Issue
Block a user