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

+9 -14
View File
@@ -10,7 +10,7 @@ use App\Entity\Disposition;
use App\Entity\Teamer;
use App\Entity\User;
use App\Security\Voter\DispositionVoter;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -23,16 +23,14 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
*/
class DispositionVoterTest extends TestCase
{
private Security&MockObject $security;
private Security&Stub $security;
protected function setUp(): void
{
$this->security = $this->createMock(Security::class);
$this->security = $this->createStub(Security::class);
}
/**
* @dataProvider documentAndFeedbackAttributes
*/
#[\PHPUnit\Framework\Attributes\DataProvider('documentAndFeedbackAttributes')]
public function testAnAdminIsDeniedOnASkipFormalitiesAssignment(string $attribute): void
{
$this->security->method('isGranted')->willReturn(true);
@@ -46,9 +44,8 @@ class DispositionVoterTest extends TestCase
/**
* The same admin on a normal assignment must still get through - the flag is the only thing
* that may take these away.
*
* @dataProvider documentAndFeedbackAttributes
*/
#[\PHPUnit\Framework\Attributes\DataProvider('documentAndFeedbackAttributes')]
public function testTheSameAdminIsGrantedOnANormalAssignment(string $attribute): void
{
$this->security->method('isGranted')->willReturn(true);
@@ -91,9 +88,8 @@ class DispositionVoterTest extends TestCase
* transition, because there is none to derive it from: while the Honorarnote is being checked
* the state machine offers nothing at all, and that is exactly when receipts must stay
* manageable.
*
* @dataProvider receiptWindowStatuses
*/
#[\PHPUnit\Framework\Attributes\DataProvider('receiptWindowStatuses')]
public function testTheReceiptWindowIsTheTwoInvoiceStates(string $status, bool $expected): void
{
$this->security->method('isGranted')->willReturn(true);
@@ -139,9 +135,8 @@ class DispositionVoterTest extends TestCase
/**
* The owning teamer gets in without being administrative; anyone else's teamer does not.
*
* @dataProvider receiptOwnership
*/
#[\PHPUnit\Framework\Attributes\DataProvider('receiptOwnership')]
public function testOnlyTheOwningTeamerMayManageTheirReceipts(bool $owning, bool $expected): void
{
$this->security
@@ -158,7 +153,7 @@ class DispositionVoterTest extends TestCase
$user = (new User())->setTeamer($owning ? $teamer : new Teamer());
$token = $this->createMock(TokenInterface::class);
$token = $this->createStub(TokenInterface::class);
$token->method('getUser')->willReturn($user);
$this->assertSame(
@@ -181,7 +176,7 @@ class DispositionVoterTest extends TestCase
private function vote(string $attribute, Disposition $disposition): int
{
return (new DispositionVoter($this->security))->vote(
$this->createMock(TokenInterface::class),
$this->createStub(TokenInterface::class),
$disposition,
[$attribute],
);