feat: upgrade phpunit to 12.5
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Repository\Groups\BoardServiceRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use App\Service\AccommodationBookingService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -26,9 +27,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*/
|
||||
class EditControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider everyStatus
|
||||
*/
|
||||
#[DataProvider('everyStatus')]
|
||||
public function testSavingNeverNotifiesTheCustomer(AccommodationBookingStatus $status): void
|
||||
{
|
||||
// Sending used to be a side effect of saving a status change, which is how an inquiry
|
||||
@@ -59,7 +58,7 @@ class EditControllerTest extends TestCase
|
||||
|
||||
private function submitEdit(AccommodationBooking $booking, AccommodationBookingService $bookingService): void
|
||||
{
|
||||
$form = $this->createMock(FormInterface::class);
|
||||
$form = $this->createStub(FormInterface::class);
|
||||
$form->method('handleRequest')->willReturn($form);
|
||||
$form->method('isSubmitted')->willReturn(true);
|
||||
$form->method('isValid')->willReturn(true);
|
||||
@@ -70,10 +69,10 @@ class EditControllerTest extends TestCase
|
||||
|
||||
$controller = new TestableEditController(
|
||||
$entityManager,
|
||||
$this->createMock(LoggerInterface::class),
|
||||
$this->createMock(BoardServiceRepository::class),
|
||||
$this->createMock(AdditionalServiceRepository::class),
|
||||
$this->createMock(UserRepository::class),
|
||||
$this->createStub(LoggerInterface::class),
|
||||
$this->createStub(BoardServiceRepository::class),
|
||||
$this->createStub(AdditionalServiceRepository::class),
|
||||
$this->createStub(UserRepository::class),
|
||||
$bookingService,
|
||||
$form,
|
||||
);
|
||||
@@ -97,7 +96,7 @@ class EditControllerTest extends TestCase
|
||||
public function testAdminGetsTheGroupsStaffAsBetreuerChoices(): void
|
||||
{
|
||||
$staff = [new User('[email protected]')];
|
||||
$userRepo = $this->createMock(UserRepository::class);
|
||||
$userRepo = $this->createStub(UserRepository::class);
|
||||
$userRepo->method('findGroupsStaff')->willReturn($staff);
|
||||
|
||||
$controller = $this->buildController($userRepo, granted: true);
|
||||
@@ -111,7 +110,7 @@ class EditControllerTest extends TestCase
|
||||
$formerManager = new User('[email protected]');
|
||||
$staff = [new User('[email protected]')];
|
||||
|
||||
$userRepo = $this->createMock(UserRepository::class);
|
||||
$userRepo = $this->createStub(UserRepository::class);
|
||||
$userRepo->method('findGroupsStaff')->willReturn($staff);
|
||||
|
||||
$booking = new AccommodationBooking();
|
||||
@@ -127,17 +126,17 @@ class EditControllerTest extends TestCase
|
||||
{
|
||||
// An unsubmitted form: index() falls through to render() and only the options
|
||||
// handed to createForm() are of interest here.
|
||||
$form = $this->createMock(FormInterface::class);
|
||||
$form = $this->createStub(FormInterface::class);
|
||||
$form->method('handleRequest')->willReturn($form);
|
||||
$form->method('isSubmitted')->willReturn(false);
|
||||
|
||||
return new TestableEditController(
|
||||
$this->createMock(EntityManagerInterface::class),
|
||||
$this->createMock(LoggerInterface::class),
|
||||
$this->createMock(BoardServiceRepository::class),
|
||||
$this->createMock(AdditionalServiceRepository::class),
|
||||
$this->createStub(EntityManagerInterface::class),
|
||||
$this->createStub(LoggerInterface::class),
|
||||
$this->createStub(BoardServiceRepository::class),
|
||||
$this->createStub(AdditionalServiceRepository::class),
|
||||
$userRepo,
|
||||
$this->createMock(AccommodationBookingService::class),
|
||||
$this->createStub(AccommodationBookingService::class),
|
||||
$form,
|
||||
$granted,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user