replace PHPUnit annotations with attributes (#5608)
This commit is contained in:
@@ -16,16 +16,18 @@ use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use App\Timesheet\LockdownService;
|
||||
use App\Validator\Constraints\TimesheetLockdown;
|
||||
use App\Validator\Constraints\TimesheetLockdownValidator;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Validator\Constraints\TimesheetLockdown
|
||||
* @covers \App\Validator\Constraints\TimesheetLockdownValidator
|
||||
* @extends ConstraintValidatorTestCase<TimesheetLockdownValidator>
|
||||
*/
|
||||
#[CoversClass(TimesheetLockdown::class)]
|
||||
#[CoversClass(TimesheetLockdownValidator::class)]
|
||||
class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
protected function createValidator(): TimesheetLockdownValidator
|
||||
@@ -141,9 +143,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase
|
||||
self::assertEmpty($this->context->getViolations());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testLockdown(bool $allowOverwriteFull, bool $allowOverwriteGrace, string $beginModifier, string $nowModifier, bool $isViolation): void
|
||||
{
|
||||
$this->validator = $this->createMyValidator($allowOverwriteFull, $allowOverwriteGrace, 'first day of last month', 'last day of last month', '+10 days');
|
||||
@@ -190,9 +190,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase
|
||||
yield [true, true, '+5 days', '+11 days', false];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getConfigTestData
|
||||
*/
|
||||
#[DataProvider('getConfigTestData')]
|
||||
public function testLockdownConfig(bool $allowOverwriteFull, bool $allowOverwriteGrace, ?string $lockdownBegin, ?string $lockdownEnd, ?string $grace, bool $isViolation): void
|
||||
{
|
||||
$this->validator = $this->createMyValidator($allowOverwriteFull, $allowOverwriteGrace, $lockdownBegin, $lockdownEnd, $grace);
|
||||
|
||||
Reference in New Issue
Block a user