Upgrade tests to PhpUnit 10 (#5252)

This commit is contained in:
Kevin Papst
2024-12-22 01:25:30 +01:00
committed by GitHub
parent 9bd37fb695
commit c7f0508707
377 changed files with 3308 additions and 3409 deletions

View File

@@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
/**
* @covers \App\Voter\TimesheetVoter
*/
class TimesheetVoterTest extends AbstractVoterTest
class TimesheetVoterTest extends AbstractVoterTestCase
{
protected function getVoter(string $voterClass): TimesheetVoter
{
@@ -36,15 +36,14 @@ class TimesheetVoterTest extends AbstractVoterTest
$token = new UsernamePasswordToken($user, 'bar', $user->getRoles());
$sut = $this->getVoter(TimesheetVoter::class);
$this->assertEquals($result, $sut->vote($token, $subject, [$attribute]));
self::assertEquals($result, $sut->vote($token, $subject, [$attribute]));
}
/**
* @dataProvider getTestData
*/
public function testVote(User $user, $subject, $attribute, $result): void
public function testVote(): void
{
$this->assertVote($user, $subject, $attribute, $result);
foreach ($this->getTestData() as $row) {
$this->assertVote($row[0], $row[1], $row[2], $row[3]);
}
}
public function getTestData()
@@ -115,7 +114,7 @@ class TimesheetVoterTest extends AbstractVoterTest
self::assertEquals($expected, $sut->vote($token, $timesheet, [$permission]));
}
public function getLockDownTestData()
public static function getLockDownTestData()
{
yield ['view', VoterInterface::ACCESS_GRANTED, '+1 days', 'first day of this month', 'last day of this month', '+10 days'];
yield ['start', VoterInterface::ACCESS_DENIED, '+1 days', 'first day of this month', 'last day of this month', '+10 days'];