chore: upgrade phpunit to 12.5

This commit is contained in:
fromme committed 2026-10-01 10:07:05 +02:00
1 parent da039d0527
commit 849da8d471
53 files changed
+832 -856

No files matched your search

@@ -8,10 +8,12 @@ use App\Entity\Teamer;
use App\Entity\User;
use App\Service\Teamer\AccountDeletionHandler;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
#[AllowMockObjectsWithoutExpectations]
class AccountDeletionHandlerTest extends TestCase
{
private EntityManagerInterface&MockObject $entityManager;
@@ -23,7 +25,7 @@ class AccountDeletionHandlerTest extends TestCase
$this->handler = new AccountDeletionHandler(
$this->entityManager,
$this->createMock(LoggerInterface::class),
$this->createStub(LoggerInterface::class),
);
}
@@ -8,17 +8,17 @@ use App\Config\SeasonCalendar;
use App\Entity\Teamer;
use App\Repository\DispositionRepository;
use App\Service\Teamer\SeasonDispositionCounter;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\TestCase;
class SeasonDispositionCounterTest extends TestCase
{
private DispositionRepository&MockObject $dispositionRepository;
private DispositionRepository&Stub $dispositionRepository;
private SeasonDispositionCounter $counter;
protected function setUp(): void
{
$this->dispositionRepository = $this->createMock(DispositionRepository::class);
$this->dispositionRepository = $this->createStub(DispositionRepository::class);
$this->counter = new SeasonDispositionCounter(
$this->dispositionRepository,
@@ -15,20 +15,23 @@ use App\Model\TeamerMailingRecipient;
use App\Model\TeamerMailingRecipientsDto;
use App\Repository\TeamerRepository;
use App\Service\Teamer\TeamerMailingService;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
#[AllowMockObjectsWithoutExpectations]
class TeamerMailingServiceTest extends TestCase
{
private TeamerRepository&MockObject $teamerRepository;
private TeamerRepository&Stub $teamerRepository;
private Mailer&MockObject $mailer;
private TeamerMailingService $service;
private static int $nextId = 1;
protected function setUp(): void
{
$this->teamerRepository = $this->createMock(TeamerRepository::class);
$this->teamerRepository = $this->createStub(TeamerRepository::class);
$this->mailer = $this->createMock(Mailer::class);
// The real renderer, not a mock: what the mailing puts in front of a teamer is
@@ -37,7 +40,7 @@ class TeamerMailingServiceTest extends TestCase
$this->teamerRepository,
$this->mailer,
new MailBodyRenderer(),
$this->createMock(LoggerInterface::class),
$this->createStub(LoggerInterface::class),
'mailing',
);
}
@@ -17,6 +17,7 @@ use App\Entity\User;
use App\Service\Teamer\TeamerProvisioner;
use App\Service\Teamer\TeamerProvisioningException;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
@@ -28,6 +29,7 @@ use Psr\Log\NullLogger;
* client: what runs, in which order, what is persisted before the next step, and what a retry does
* after a failure halfway.
*/
#[AllowMockObjectsWithoutExpectations]
class TeamerProvisionerTest extends TestCase
{
private const SELECTION_ID = 1070;
@@ -366,7 +368,7 @@ class TeamerProvisionerTest extends TestCase
return new TeamerProvisioner(
$this->apiClient,
$this->userDataHandler,
$this->createMock(EntityManagerInterface::class),
$this->createStub(EntityManagerInterface::class),
new NullLogger(),
self::SELECTION_ID,
);