replace PHPUnit annotations with attributes (#5608)

This commit is contained in:
Kevin Papst
2025-08-11 18:57:42 +02:00
committed by GitHub
parent 04331420ae
commit 24778d3ffb
599 changed files with 1778 additions and 2313 deletions

View File

@@ -62,7 +62,7 @@ jobs:
run: APP_ENV=dev bin/console kimai:reload -n run: APP_ENV=dev bin/console kimai:reload -n
- name: Check codestyles - name: Check codestyles
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr run: vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr
- name: Run PHPStan for application - name: Run PHPStan for application
run: vendor/bin/phpstan analyse -c phpstan.neon --no-progress --error-format=checkstyle | cs2pr run: vendor/bin/phpstan analyse -c phpstan.neon --no-progress --error-format=checkstyle | cs2pr

View File

@@ -8,6 +8,7 @@ file that was distributed with this source code.
COMMENT; COMMENT;
$fixer = new PhpCsFixer\Config(); $fixer = new PhpCsFixer\Config();
$fixer->setUnsupportedPhpVersionAllowed(true);
$fixer $fixer
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRiskyAllowed(true) ->setRiskyAllowed(true)

View File

@@ -19,7 +19,7 @@ use App\Timesheet\DateTimeFactory;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeInterface; use DateTimeInterface;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Query; use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Psr\EventDispatcher\EventDispatcherInterface; use Psr\EventDispatcher\EventDispatcherInterface;
@@ -112,7 +112,7 @@ class CustomerStatisticService
$qb = $this->timesheetRepository->createQueryBuilder('t'); $qb = $this->timesheetRepository->createQueryBuilder('t');
$qb $qb
->select('IDENTITY(p.customer) AS id') ->select('IDENTITY(p.customer) AS id')
->join(Project::class, 'p', Query\Expr\Join::WITH, 't.project = p.id') ->join(Project::class, 'p', Join::WITH, 't.project = p.id')
->addSelect('COALESCE(SUM(t.duration), 0) as duration') ->addSelect('COALESCE(SUM(t.duration), 0) as duration')
->addSelect('COALESCE(SUM(t.rate), 0) as rate') ->addSelect('COALESCE(SUM(t.rate), 0) as rate')
->addSelect('COALESCE(SUM(t.internalRate), 0) as internalRate') ->addSelect('COALESCE(SUM(t.internalRate), 0) as internalRate')

View File

@@ -33,7 +33,7 @@ use Doctrine\ORM\Query\Expr\Andx;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
/** /**
* @extends \Doctrine\ORM\EntityRepository<Activity> * @extends EntityRepository<Activity>
*/ */
class ActivityRepository extends EntityRepository class ActivityRepository extends EntityRepository
{ {

View File

@@ -14,7 +14,7 @@ use App\Entity\CustomerRate;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
/** /**
* @extends \Doctrine\ORM\EntityRepository<CustomerRate> * @extends EntityRepository<CustomerRate>
*/ */
class CustomerRateRepository extends EntityRepository class CustomerRateRepository extends EntityRepository
{ {

View File

@@ -13,7 +13,7 @@ use App\Entity\ExportTemplate;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
/** /**
* @extends \Doctrine\ORM\EntityRepository<ExportTemplate> * @extends EntityRepository<ExportTemplate>
*/ */
class ExportTemplateRepository extends EntityRepository class ExportTemplateRepository extends EntityRepository
{ {

View File

@@ -26,7 +26,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
/** /**
* @extends \Doctrine\ORM\EntityRepository<Invoice> * @extends EntityRepository<Invoice>
*/ */
class InvoiceRepository extends EntityRepository class InvoiceRepository extends EntityRepository
{ {

View File

@@ -19,7 +19,7 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
/** /**
* @extends \Doctrine\ORM\EntityRepository<InvoiceTemplate> * @extends EntityRepository<InvoiceTemplate>
*/ */
class InvoiceTemplateRepository extends EntityRepository class InvoiceTemplateRepository extends EntityRepository
{ {

View File

@@ -14,7 +14,7 @@ use App\Entity\ProjectRate;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
/** /**
* @extends \Doctrine\ORM\EntityRepository<ProjectRate> * @extends EntityRepository<ProjectRate>
*/ */
class ProjectRateRepository extends EntityRepository class ProjectRateRepository extends EntityRepository
{ {

View File

@@ -36,7 +36,7 @@ use Doctrine\ORM\Query\Expr\Andx;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
/** /**
* @extends \Doctrine\ORM\EntityRepository<Project> * @extends EntityRepository<Project>
*/ */
class ProjectRepository extends EntityRepository class ProjectRepository extends EntityRepository
{ {

View File

@@ -14,7 +14,7 @@ use App\Entity\RolePermission;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
/** /**
* @extends \Doctrine\ORM\EntityRepository<RolePermission> * @extends EntityRepository<RolePermission>
*/ */
class RolePermissionRepository extends EntityRepository class RolePermissionRepository extends EntityRepository
{ {

View File

@@ -14,7 +14,7 @@ use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Exception\ORMException; use Doctrine\ORM\Exception\ORMException;
/** /**
* @extends \Doctrine\ORM\EntityRepository<Role> * @extends EntityRepository<Role>
* @method Role[] findAll() * @method Role[] findAll()
*/ */
class RoleRepository extends EntityRepository class RoleRepository extends EntityRepository

View File

@@ -11,6 +11,7 @@ namespace App\Validator\Constraints;
use App\Configuration\SystemConfiguration; use App\Configuration\SystemConfiguration;
use App\Entity\Timesheet as TimesheetEntity; use App\Entity\Timesheet as TimesheetEntity;
use App\Utils\Duration;
use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedTypeException;
@@ -64,7 +65,7 @@ final class TimesheetLongRunningValidator extends ConstraintValidator
return; return;
} }
$format = new \App\Utils\Duration(); $format = new Duration();
$hours = $format->format($maxMinutes * 60); $hours = $format->format($maxMinutes * 60);
$this->context->buildViolation($constraint->message) $this->context->buildViolation($constraint->message)

View File

@@ -14,10 +14,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
use App\Tests\DataFixtures\CustomerFixtures; use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ActionsControllerTest extends APIControllerBaseTestCase class ActionsControllerTest extends APIControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -21,13 +21,13 @@ use App\Repository\ActivityRateRepository;
use App\Repository\ActivityRepository; use App\Repository\ActivityRepository;
use App\Repository\Query\VisibilityInterface; use App\Repository\Query\VisibilityInterface;
use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock; use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class ActivityControllerTest extends APIControllerBaseTestCase class ActivityControllerTest extends APIControllerBaseTestCase
{ {
use RateControllerTestTrait; use RateControllerTestTrait;
@@ -140,9 +140,7 @@ class ActivityControllerTest extends APIControllerBaseTestCase
return [$project, $project2, $activity1]; return [$project, $project2, $activity1];
} }
/** #[DataProvider('getCollectionTestData')]
* @dataProvider getCollectionTestData
*/
public function testGetCollection($url, $project, $parameters, $expected): void public function testGetCollection($url, $project, $parameters, $expected): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $client = $this->getClientForAuthenticatedUser(User::ROLE_USER);

View File

@@ -11,10 +11,9 @@ namespace App\Tests\API;
use App\Entity\User; use App\Entity\User;
use App\Tests\Controller\AbstractControllerBaseTestCase; use App\Tests\Controller\AbstractControllerBaseTestCase;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ApiDocControllerTest extends AbstractControllerBaseTestCase class ApiDocControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -13,12 +13,11 @@ use App\API\Authentication\AccessTokenHandler;
use App\Entity\AccessToken; use App\Entity\AccessToken;
use App\Entity\User; use App\Entity\User;
use App\Repository\AccessTokenRepository; use App\Repository\AccessTokenRepository;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\Security\Core\Exception\BadCredentialsException;
/** #[CoversClass(AccessTokenHandler::class)]
* @covers \App\API\Authentication\AccessTokenHandler
*/
class AccessTokenHandlerTest extends TestCase class AccessTokenHandlerTest extends TestCase
{ {
private function getSut(?AccessToken $accessToken = null): AccessTokenHandler private function getSut(?AccessToken $accessToken = null): AccessTokenHandler

View File

@@ -12,6 +12,8 @@ namespace App\Tests\API\Authentication;
use App\API\Authentication\TokenAuthenticator; use App\API\Authentication\TokenAuthenticator;
use App\Entity\User; use App\Entity\User;
use App\Repository\ApiUserRepository; use App\Repository\ApiUserRepository;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
@@ -21,10 +23,8 @@ use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationExc
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge; use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials; use Symfony\Component\Security\Http\Authenticator\Passport\Credentials\CustomCredentials;
/** #[CoversClass(TokenAuthenticator::class)]
* @covers \App\API\Authentication\TokenAuthenticator #[Group('legacy')]
* @group legacy
*/
class TokenAuthenticatorTest extends TestCase class TokenAuthenticatorTest extends TestCase
{ {
private function getSut(bool $verify = true): TokenAuthenticator private function getSut(bool $verify = true): TokenAuthenticator

View File

@@ -11,14 +11,14 @@ namespace App\Tests\API;
use App\DataFixtures\UserFixtures; use App\DataFixtures\UserFixtures;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** /**
* These tests make sure, that the deprecated API login with X-AUTH-USER and X-AUTH-TOKEN still works. * Make sure that the deprecated API login with X-AUTH-USER and X-AUTH-TOKEN still works.
*
* @group legacy
* @group integration
*/ */
#[Group('legacy')]
#[Group('integration')]
class AuthenticationTest extends APIControllerBaseTestCase class AuthenticationTest extends APIControllerBaseTestCase
{ {
public function testPinIsSecure(): void public function testPinIsSecure(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\API; namespace App\Tests\API;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ConfigurationControllerTest extends APIControllerBaseTestCase class ConfigurationControllerTest extends APIControllerBaseTestCase
{ {
public function testIsTimesheetSecure(): void public function testIsTimesheetSecure(): void

View File

@@ -21,13 +21,12 @@ use App\Entity\User;
use App\Repository\CustomerRateRepository; use App\Repository\CustomerRateRepository;
use App\Repository\CustomerRepository; use App\Repository\CustomerRepository;
use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock; use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class CustomerControllerTest extends APIControllerBaseTestCase class CustomerControllerTest extends APIControllerBaseTestCase
{ {
use RateControllerTestTrait; use RateControllerTestTrait;

View File

@@ -12,12 +12,11 @@ namespace App\Tests\API;
use App\Entity\ExportTemplate; use App\Entity\ExportTemplate;
use App\Entity\User; use App\Entity\User;
use App\Repository\ExportTemplateRepository; use App\Repository\ExportTemplateRepository;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class ExportControllerTest extends APIControllerBaseTestCase class ExportControllerTest extends APIControllerBaseTestCase
{ {
private function importExportTemplate(): ExportTemplate private function importExportTemplate(): ExportTemplate

View File

@@ -12,10 +12,9 @@ namespace App\Tests\API;
use App\Entity\Invoice; use App\Entity\Invoice;
use App\Entity\User; use App\Entity\User;
use App\Tests\DataFixtures\InvoiceFixtures; use App\Tests\DataFixtures\InvoiceFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class InvoiceControllerTest extends APIControllerBaseTestCase class InvoiceControllerTest extends APIControllerBaseTestCase
{ {
/** /**

View File

@@ -10,11 +10,10 @@
namespace App\Tests\API\Model; namespace App\Tests\API\Model;
use App\API\Model\PageAction; use App\API\Model\PageAction;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(PageAction::class)]
* @covers \App\API\Model\PageAction
*/
class PageActionTest extends TestCase class PageActionTest extends TestCase
{ {
public function testEmptySettings(): void public function testEmptySettings(): void

View File

@@ -10,11 +10,10 @@
namespace App\Tests\API\Model; namespace App\Tests\API\Model;
use App\API\Model\TimesheetConfig; use App\API\Model\TimesheetConfig;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(TimesheetConfig::class)]
* @covers \App\API\Model\TimesheetConfig
*/
class TimesheetConfigTest extends TestCase class TimesheetConfigTest extends TestCase
{ {
public function testSetter(): void public function testSetter(): void

View File

@@ -11,11 +11,10 @@ namespace App\Tests\API\Model;
use App\API\Model\Version; use App\API\Model\Version;
use App\Constants; use App\Constants;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(Version::class)]
* @covers \App\API\Model\Version
*/
class VersionTest extends TestCase class VersionTest extends TestCase
{ {
public function testValues(): void public function testValues(): void

View File

@@ -10,11 +10,10 @@
namespace App\Tests\API; namespace App\Tests\API;
use App\API\NotFoundException; use App\API\NotFoundException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(NotFoundException::class)]
* @covers \App\API\NotFoundException
*/
class NotFoundExceptionTest extends TestCase class NotFoundExceptionTest extends TestCase
{ {
public function testConstructor(): void public function testConstructor(): void

View File

@@ -21,13 +21,13 @@ use App\Repository\ProjectRateRepository;
use App\Repository\ProjectRepository; use App\Repository\ProjectRepository;
use App\Repository\Query\VisibilityInterface; use App\Repository\Query\VisibilityInterface;
use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock; use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class ProjectControllerTest extends APIControllerBaseTestCase class ProjectControllerTest extends APIControllerBaseTestCase
{ {
use RateControllerTestTrait; use RateControllerTestTrait;
@@ -191,9 +191,7 @@ class ProjectControllerTest extends APIControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getCollectionTestData')]
* @dataProvider getCollectionTestData
*/
public function testGetCollectionWithParams(string $url, ?int $project, array $parameters, array $expected): void public function testGetCollectionWithParams(string $url, ?int $project, array $parameters, array $expected): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $client = $this->getClientForAuthenticatedUser(User::ROLE_USER);

View File

@@ -15,6 +15,7 @@ use FOS\RestBundle\Serializer\Normalizer\FlattenExceptionHandler;
use JMS\Serializer\GraphNavigatorInterface; use JMS\Serializer\GraphNavigatorInterface;
use JMS\Serializer\JsonSerializationVisitor; use JMS\Serializer\JsonSerializationVisitor;
use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializationContext;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Security; use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\ErrorHandler\Exception\FlattenException; use Symfony\Component\ErrorHandler\Exception\FlattenException;
@@ -22,9 +23,7 @@ use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
/** #[CoversClass(ValidationFailedExceptionErrorHandler::class)]
* @covers \App\API\Serializer\ValidationFailedExceptionErrorHandler
*/
class ValidationFailedExceptionErrorHandlerTest extends TestCase class ValidationFailedExceptionErrorHandlerTest extends TestCase
{ {
public function testSubscribingMethods(): void public function testSubscribingMethods(): void

View File

@@ -11,10 +11,9 @@ namespace App\Tests\API;
use App\Constants; use App\Constants;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class StatusControllerTest extends APIControllerBaseTestCase class StatusControllerTest extends APIControllerBaseTestCase
{ {
public function testIsSecurePing(): void public function testIsSecurePing(): void

View File

@@ -12,11 +12,10 @@ namespace App\Tests\API;
use App\Entity\Tag; use App\Entity\Tag;
use App\Entity\User; use App\Entity\User;
use App\Tests\DataFixtures\TagFixtures; use App\Tests\DataFixtures\TagFixtures;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class TagControllerTest extends APIControllerBaseTestCase class TagControllerTest extends APIControllerBaseTestCase
{ {
/** /**

View File

@@ -13,11 +13,11 @@ use App\Entity\Team;
use App\Entity\User; use App\Entity\User;
use App\Tests\DataFixtures\TeamFixtures; use App\Tests\DataFixtures\TeamFixtures;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class TeamControllerTest extends APIControllerBaseTestCase class TeamControllerTest extends APIControllerBaseTestCase
{ {
/** /**
@@ -47,9 +47,7 @@ class TeamControllerTest extends APIControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getRoleTestData')]
* @dataProvider getRoleTestData
*/
public function testIsSecureForRole(string $role): void public function testIsSecureForRole(string $role): void
{ {
$this->assertUrlIsSecuredForRole($role, '/api/teams'); $this->assertUrlIsSecuredForRole($role, '/api/teams');

View File

@@ -20,12 +20,12 @@ use App\Entity\User;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\Mocks\TimesheetTestMetaFieldSubscriberMock; use App\Tests\Mocks\TimesheetTestMetaFieldSubscriberMock;
use App\Timesheet\DateTimeFactory; use App\Timesheet\DateTimeFactory;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/** #[Group('integration')]
* @group integration
*/
class TimesheetControllerTest extends APIControllerBaseTestCase class TimesheetControllerTest extends APIControllerBaseTestCase
{ {
public const DATE_FORMAT = 'Y-m-d H:i:s'; public const DATE_FORMAT = 'Y-m-d H:i:s';
@@ -779,9 +779,7 @@ class TimesheetControllerTest extends APIControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getTrackingModeTestData')]
* @dataProvider getTrackingModeTestData
*/
public function testCreateActionWithTrackingModeHasFieldsForUser(string $trackingMode, string $user, bool $showTimes): void public function testCreateActionWithTrackingModeHasFieldsForUser(string $trackingMode, string $user, bool $showTimes): void
{ {
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE)); $dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));

View File

@@ -10,10 +10,10 @@
namespace App\Tests\API; namespace App\Tests\API;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class UserControllerTest extends APIControllerBaseTestCase class UserControllerTest extends APIControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void
@@ -33,9 +33,7 @@ class UserControllerTest extends APIControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getRoleTestData')]
* @dataProvider getRoleTestData
*/
public function testIsSecureForRole(string $role): void public function testIsSecureForRole(string $role): void
{ {
$this->assertUrlIsSecuredForRole($role, '/api/users'); $this->assertUrlIsSecuredForRole($role, '/api/users');

View File

@@ -21,15 +21,15 @@ use App\Event\ActivityUpdatePreEvent;
use App\Repository\ActivityRepository; use App\Repository\ActivityRepository;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use App\Validator\ValidationFailedException; use App\Validator\ValidationFailedException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface;
/** #[CoversClass(ActivityService::class)]
* @covers \App\Activity\ActivityService
*/
class ActivityServiceTest extends TestCase class ActivityServiceTest extends TestCase
{ {
private function getSut( private function getSut(
@@ -144,9 +144,7 @@ class ActivityServiceTest extends TestCase
self::assertNull($project->getProject()); self::assertNull($project->getProject());
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testActivityNumber(string $format, int|string $expected): void public function testActivityNumber(string $format, int|string $expected): void
{ {
$sut = $this->getSut(null, null, null, ['number_format' => $format]); $sut = $this->getSut(null, null, null, ['number_format' => $format]);

View File

@@ -11,11 +11,10 @@ namespace App\Tests\Calendar;
use App\Calendar\CalendarSource; use App\Calendar\CalendarSource;
use App\Calendar\CalendarSourceType; use App\Calendar\CalendarSourceType;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(CalendarSource::class)]
* @covers \App\Calendar\CalendarSource
*/
class CalendarSourceTest extends TestCase class CalendarSourceTest extends TestCase
{ {
public function testSource(): void public function testSource(): void

View File

@@ -10,11 +10,10 @@
namespace App\Tests\Calendar; namespace App\Tests\Calendar;
use App\Calendar\GoogleSource; use App\Calendar\GoogleSource;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(GoogleSource::class)]
* @covers \App\Calendar\GoogleSource
*/
class GoogleSourceTest extends TestCase class GoogleSourceTest extends TestCase
{ {
public function testConstruct(): void public function testConstruct(): void

View File

@@ -11,11 +11,10 @@ namespace App\Tests\Calendar;
use App\Calendar\Google; use App\Calendar\Google;
use App\Calendar\GoogleSource; use App\Calendar\GoogleSource;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(Google::class)]
* @covers \App\Calendar\Google
*/
class GoogleTest extends TestCase class GoogleTest extends TestCase
{ {
public function testConstruct(): void public function testConstruct(): void

View File

@@ -12,11 +12,10 @@ namespace App\Tests\Calendar;
use App\Calendar\RecentActivitiesSource; use App\Calendar\RecentActivitiesSource;
use App\Calendar\TimesheetEntry; use App\Calendar\TimesheetEntry;
use App\Entity\Timesheet; use App\Entity\Timesheet;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(RecentActivitiesSource::class)]
* @covers \App\Calendar\RecentActivitiesSource
*/
class RecentActivitiesSourceTest extends TestCase class RecentActivitiesSourceTest extends TestCase
{ {
public function testConstruct(): void public function testConstruct(): void

View File

@@ -14,11 +14,10 @@ use App\Entity\Activity;
use App\Entity\Project; use App\Entity\Project;
use App\Entity\Tag; use App\Entity\Tag;
use App\Entity\Timesheet; use App\Entity\Timesheet;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(TimesheetEntry::class)]
* @covers \App\Calendar\TimesheetEntry
*/
class TimesheetEntryTest extends TestCase class TimesheetEntryTest extends TestCase
{ {
public function testConstruct(): void public function testConstruct(): void

View File

@@ -14,15 +14,15 @@ use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(ActivateUserCommand::class)]
* @covers \App\Command\ActivateUserCommand #[Group('integration')]
* @group integration
*/
class ActivateUserCommandTest extends KernelTestCase class ActivateUserCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -10,6 +10,8 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\AbstractBundleInstallerCommand; use App\Command\AbstractBundleInstallerCommand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
@@ -18,10 +20,8 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(AbstractBundleInstallerCommand::class)]
* @covers \App\Command\AbstractBundleInstallerCommand #[Group('integration')]
* @group integration
*/
class BundleInstallerCommandTest extends KernelTestCase class BundleInstallerCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -9,22 +9,23 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\AbstractUserCommand;
use App\Command\ChangePasswordCommand; use App\Command\ChangePasswordCommand;
use App\Entity\User; use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
/** #[CoversClass(ChangePasswordCommand::class)]
* @covers \App\Command\ChangePasswordCommand #[CoversClass(AbstractUserCommand::class)]
* @covers \App\Command\AbstractUserCommand #[Group('integration')]
* @group integration
*/
class ChangePasswordCommandTest extends KernelTestCase class ChangePasswordCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -14,14 +14,14 @@ use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(CreateUserCommand::class)]
* @covers \App\Command\CreateUserCommand #[Group('integration')]
* @group integration
*/
class CreateUserCommandTest extends KernelTestCase class CreateUserCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -14,15 +14,15 @@ use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(DeactivateUserCommand::class)]
* @covers \App\Command\DeactivateUserCommand #[Group('integration')]
* @group integration
*/
class DeactivateUserCommandTest extends KernelTestCase class DeactivateUserCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -9,21 +9,22 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\AbstractRoleCommand;
use App\Command\DemoteUserCommand; use App\Command\DemoteUserCommand;
use App\Entity\User; use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(AbstractRoleCommand::class)]
* @covers \App\Command\AbstractRoleCommand #[CoversClass(DemoteUserCommand::class)]
* @covers \App\Command\DemoteUserCommand #[Group('integration')]
* @group integration
*/
class DemoteUserCommandTest extends KernelTestCase class DemoteUserCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -23,16 +23,16 @@ use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\KernelTestTrait; use App\Tests\KernelTestTrait;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\MailerInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
/** #[CoversClass(ExportCreateCommand::class)]
* @covers \App\Command\ExportCreateCommand #[Group('integration')]
* @group integration
*/
class ExportCreateCommandTest extends KernelTestCase class ExportCreateCommandTest extends KernelTestCase
{ {
use KernelTestTrait; use KernelTestTrait;

View File

@@ -11,13 +11,13 @@ namespace App\Tests\Command;
use App\Command\InstallCommand; use App\Command\InstallCommand;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/** #[CoversClass(InstallCommand::class)]
* @covers \App\Command\InstallCommand #[Group('integration')]
* @group integration
*/
class InstallCommandTest extends KernelTestCase class InstallCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -23,14 +23,14 @@ use App\Tests\DataFixtures\InvoiceTemplateFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\KernelTestTrait; use App\Tests\KernelTestTrait;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(InvoiceCreateCommand::class)]
* @covers \App\Command\InvoiceCreateCommand #[Group('integration')]
* @group integration
*/
class InvoiceCreateCommandTest extends KernelTestCase class InvoiceCreateCommandTest extends KernelTestCase
{ {
use KernelTestTrait; use KernelTestTrait;

View File

@@ -11,14 +11,14 @@ namespace App\Tests\Command;
use App\Command\ListUserCommand; use App\Command\ListUserCommand;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(ListUserCommand::class)]
* @covers \App\Command\ListUserCommand #[Group('integration')]
* @group integration
*/
class ListUserCommandTest extends KernelTestCase class ListUserCommandTest extends KernelTestCase
{ {
public function testWithPlugins(): void public function testWithPlugins(): void

View File

@@ -10,14 +10,14 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\MailTestCommand; use App\Command\MailTestCommand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Psr\EventDispatcher\EventDispatcherInterface; use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/** #[CoversClass(MailTestCommand::class)]
* @covers \App\Command\MailTestCommand #[Group('integration')]
* @group integration
*/
class MailTestCommandTest extends KernelTestCase class MailTestCommandTest extends KernelTestCase
{ {
protected Application $application; protected Application $application;

View File

@@ -13,14 +13,14 @@ use App\Command\PluginCommand;
use App\Plugin\PackageManager; use App\Plugin\PackageManager;
use App\Plugin\PluginInterface; use App\Plugin\PluginInterface;
use App\Plugin\PluginManager; use App\Plugin\PluginManager;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(PluginCommand::class)]
* @covers \App\Command\PluginCommand #[Group('integration')]
* @group integration
*/
class PluginCommandTest extends KernelTestCase class PluginCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -9,21 +9,22 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\AbstractRoleCommand;
use App\Command\PromoteUserCommand; use App\Command\PromoteUserCommand;
use App\Entity\User; use App\Entity\User;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use App\User\UserService; use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry; use Doctrine\Bundle\DoctrineBundle\Registry;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(AbstractRoleCommand::class)]
* @covers \App\Command\AbstractRoleCommand #[CoversClass(PromoteUserCommand::class)]
* @covers \App\Command\PromoteUserCommand #[Group('integration')]
* @group integration
*/
class PromoteUserCommandTest extends KernelTestCase class PromoteUserCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -10,13 +10,13 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\ReloadCommand; use App\Command\ReloadCommand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/** #[CoversClass(ReloadCommand::class)]
* @covers \App\Command\ReloadCommand #[Group('integration')]
* @group integration
*/
class ReloadCommandTest extends KernelTestCase class ReloadCommandTest extends KernelTestCase
{ {
protected Application $application; protected Application $application;

View File

@@ -10,13 +10,13 @@
namespace App\Tests\Command; namespace App\Tests\Command;
use App\Command\ResetDevelopmentCommand; use App\Command\ResetDevelopmentCommand;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/** #[CoversClass(ResetDevelopmentCommand::class)]
* @covers \App\Command\ResetDevelopmentCommand #[Group('integration')]
* @group integration
*/
class ResetDevelopmentCommandTest extends KernelTestCase class ResetDevelopmentCommandTest extends KernelTestCase
{ {
public function testCommandName(): void public function testCommandName(): void

View File

@@ -11,14 +11,14 @@ namespace App\Tests\Command;
use App\Command\ResetTestCommand; use App\Command\ResetTestCommand;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
/** #[CoversClass(ResetTestCommand::class)]
* @covers \App\Command\ResetTestCommand #[Group('integration')]
* @group integration
*/
class ResetTestCommandTest extends KernelTestCase class ResetTestCommandTest extends KernelTestCase
{ {
public function testCommandName(): void public function testCommandName(): void

View File

@@ -11,14 +11,14 @@ namespace App\Tests\Command;
use App\Command\TimesheetStopAllCommand; use App\Command\TimesheetStopAllCommand;
use App\Tests\Mocks\TimesheetServiceFactory; use App\Tests\Mocks\TimesheetServiceFactory;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(TimesheetStopAllCommand::class)]
* @covers \App\Command\TimesheetStopAllCommand #[Group('integration')]
* @group integration
*/
class TimesheetStopAllCommandTest extends KernelTestCase class TimesheetStopAllCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -11,15 +11,15 @@ namespace App\Tests\Command;
use App\Command\UserLoginLinkCommand; use App\Command\UserLoginLinkCommand;
use App\Repository\UserRepository; use App\Repository\UserRepository;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface; use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface;
/** #[CoversClass(UserLoginLinkCommand::class)]
* @covers \App\Command\UserLoginLinkCommand #[Group('integration')]
* @group integration
*/
class UserLoginLinkCommandTest extends KernelTestCase class UserLoginLinkCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;

View File

@@ -11,14 +11,15 @@ namespace App\Tests\Command;
use App\Command\VersionCommand; use App\Command\VersionCommand;
use App\Constants; use App\Constants;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Tester\CommandTester;
/** #[CoversClass(VersionCommand::class)]
* @covers \App\Command\VersionCommand #[Group('integration')]
* @group integration
*/
class VersionCommandTest extends KernelTestCase class VersionCommandTest extends KernelTestCase
{ {
private Application $application; private Application $application;
@@ -32,9 +33,7 @@ class VersionCommandTest extends KernelTestCase
$this->application->add(new VersionCommand()); $this->application->add(new VersionCommand());
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testVersion(array $options, $result): void public function testVersion(array $options, $result): void
{ {
$commandTester = $this->getCommandTester($options); $commandTester = $this->getCommandTester($options);

View File

@@ -10,13 +10,13 @@
namespace App\Tests\Configuration; namespace App\Tests\Configuration;
use App\Configuration\LdapConfiguration; use App\Configuration\LdapConfiguration;
use App\Configuration\SystemConfiguration;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(LdapConfiguration::class)]
* @covers \App\Configuration\LdapConfiguration #[CoversClass(SystemConfiguration::class)]
* @covers \App\Configuration\SystemConfiguration
*/
class LdapConfigurationTest extends TestCase class LdapConfigurationTest extends TestCase
{ {
protected function getSut(array $settings) protected function getSut(array $settings)

View File

@@ -10,11 +10,11 @@
namespace App\Tests\Configuration; namespace App\Tests\Configuration;
use App\Configuration\LocaleService; use App\Configuration\LocaleService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(LocaleService::class)]
* @covers \App\Configuration\LocaleService
*/
class LocaleServiceTest extends TestCase class LocaleServiceTest extends TestCase
{ {
protected function getSut(array $settings): LocaleService protected function getSut(array $settings): LocaleService
@@ -146,9 +146,7 @@ class LocaleServiceTest extends TestCase
self::assertEquals('H:i:s', $sut->getTimeFormat('en')); self::assertEquals('H:i:s', $sut->getTimeFormat('en'));
} }
/** #[DataProvider('getNearestTranslationLocaleData')]
* @dataProvider getNearestTranslationLocaleData
*/
public function testGetNearestTranslationLocale(string $locale, string $expected): void public function testGetNearestTranslationLocale(string $locale, string $expected): void
{ {
$sut = $this->getSut($this->getDefaultSettings()); $sut = $this->getSut($this->getDefaultSettings());

View File

@@ -10,11 +10,10 @@
namespace App\Tests\Configuration; namespace App\Tests\Configuration;
use App\Configuration\MailConfiguration; use App\Configuration\MailConfiguration;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(MailConfiguration::class)]
* @covers \App\Configuration\MailConfiguration
*/
class MailConfigurationTest extends TestCase class MailConfigurationTest extends TestCase
{ {
public function testGetFromAddress(): void public function testGetFromAddress(): void

View File

@@ -10,13 +10,13 @@
namespace App\Tests\Configuration; namespace App\Tests\Configuration;
use App\Configuration\SamlConfiguration; use App\Configuration\SamlConfiguration;
use App\Configuration\SystemConfiguration;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(SamlConfiguration::class)]
* @covers \App\Configuration\SamlConfiguration #[CoversClass(SystemConfiguration::class)]
* @covers \App\Configuration\SystemConfiguration
*/
class SamlConfigurationTest extends TestCase class SamlConfigurationTest extends TestCase
{ {
protected function getSut(array $settings) protected function getSut(array $settings)

View File

@@ -12,11 +12,10 @@ namespace App\Tests\Configuration;
use App\Configuration\SystemConfiguration; use App\Configuration\SystemConfiguration;
use App\Entity\Configuration; use App\Entity\Configuration;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(SystemConfiguration::class)]
* @covers \App\Configuration\SystemConfiguration
*/
class SystemConfigurationTest extends TestCase class SystemConfigurationTest extends TestCase
{ {
/** /**

View File

@@ -11,12 +11,11 @@ namespace App\Tests;
use App\ConsoleApplication; use App\ConsoleApplication;
use App\Constants; use App\Constants;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
/** #[CoversClass(ConsoleApplication::class)]
* @covers \App\ConsoleApplication
*/
class ConsoleApplicationTest extends TestCase class ConsoleApplicationTest extends TestCase
{ {
public function testVersion(): void public function testVersion(): void

View File

@@ -10,11 +10,10 @@
namespace App\Tests; namespace App\Tests;
use App\Constants; use App\Constants;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** #[CoversClass(Constants::class)]
* @covers \App\Constants
*/
class ConstantsTest extends TestCase class ConstantsTest extends TestCase
{ {
public function testBuild(): void public function testBuild(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class AboutControllerTest extends AbstractControllerBaseTestCase class AboutControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIndexAction(): void public function testIndexAction(): void

View File

@@ -19,13 +19,13 @@ use App\Tests\DataFixtures\TeamFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock; use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\DomCrawler\Field\ChoiceFormField; use Symfony\Component\DomCrawler\Field\ChoiceFormField;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
/** #[Group('integration')]
* @group integration
*/
class ActivityControllerTest extends AbstractControllerBaseTestCase class ActivityControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void
@@ -427,9 +427,7 @@ class ActivityControllerTest extends AbstractControllerBaseTestCase
self::assertFalse($client->getResponse()->isSuccessful()); self::assertFalse($client->getResponse()->isSuccessful());
} }
/** #[DataProvider('getValidationTestData')]
* @dataProvider getValidationTestData
*/
public function testValidationForCreateAction(array $formData, array $validationFields): void public function testValidationForCreateAction(array $formData, array $validationFields): void
{ {
$this->assertFormHasValidationError( $this->assertFormHasValidationError(

View File

@@ -19,15 +19,14 @@ use App\Tests\Mocks\Saml\SamlAuthFactoryFactory;
use App\Tests\Mocks\SecurityFactory; use App\Tests\Mocks\SecurityFactory;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use OneLogin\Saml2\Auth; use OneLogin\Saml2\Auth;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Security\Http\SecurityRequestAttributes; use Symfony\Component\Security\Http\SecurityRequestAttributes;
/** #[Group('integration')]
* @group integration
*/
class SamlControllerTest extends TestCase class SamlControllerTest extends TestCase
{ {
protected function getSystemConfigurationMock(array $settings, array $loaderSettings = []): SystemConfiguration protected function getSystemConfigurationMock(array $settings, array $loaderSettings = []): SystemConfiguration

View File

@@ -14,10 +14,9 @@ use App\Entity\User;
use App\Tests\Configuration\TestConfigLoader; use App\Tests\Configuration\TestConfigLoader;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\Mocks\SystemConfigurationFactory; use App\Tests\Mocks\SystemConfigurationFactory;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class CalendarControllerTest extends AbstractControllerBaseTestCase class CalendarControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ContractControllerTest extends AbstractControllerBaseTestCase class ContractControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -20,13 +20,13 @@ use App\Tests\DataFixtures\TeamFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock; use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\DomCrawler\Field\ChoiceFormField; use Symfony\Component\DomCrawler\Field\ChoiceFormField;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
/** #[Group('integration')]
* @group integration
*/
class CustomerControllerTest extends AbstractControllerBaseTestCase class CustomerControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void
@@ -513,9 +513,7 @@ class CustomerControllerTest extends AbstractControllerBaseTestCase
self::assertFalse($client->getResponse()->isSuccessful()); self::assertFalse($client->getResponse()->isSuccessful());
} }
/** #[DataProvider('getValidationTestData')]
* @dataProvider getValidationTestData
*/
public function testValidationForCreateAction(array $formData, array $validationFields): void public function testValidationForCreateAction(array $formData, array $validationFields): void
{ {
$this->assertFormHasValidationError( $this->assertFormHasValidationError(

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class DashboardControllerTest extends AbstractControllerBaseTestCase class DashboardControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class DoctorControllerTest extends AbstractControllerBaseTestCase class DoctorControllerTest extends AbstractControllerBaseTestCase
{ {
public function testDoctorIsSecure(): void public function testDoctorIsSecure(): void

View File

@@ -16,11 +16,10 @@ use App\Entity\User;
use App\Tests\DataFixtures\ExportTemplateFixtures; use App\Tests\DataFixtures\ExportTemplateFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\DomCrawler\Field\FormField; use Symfony\Component\DomCrawler\Field\FormField;
/** #[Group('integration')]
* @group integration
*/
class ExportControllerTest extends AbstractControllerBaseTestCase class ExportControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -11,10 +11,9 @@ namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class FavoriteControllerTest extends AbstractControllerBaseTestCase class FavoriteControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class HelpControllerTest extends AbstractControllerBaseTestCase class HelpControllerTest extends AbstractControllerBaseTestCase
{ {
public function testHelpLocalesAction(): void public function testHelpLocalesAction(): void

View File

@@ -12,10 +12,9 @@ namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use App\Entity\UserPreference; use App\Entity\UserPreference;
use App\Form\Type\InitialViewType; use App\Form\Type\InitialViewType;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class HomepageControllerTest extends AbstractControllerBaseTestCase class HomepageControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -15,11 +15,10 @@ use App\Entity\Timesheet;
use App\Entity\User; use App\Entity\User;
use App\Tests\DataFixtures\InvoiceTemplateFixtures; use App\Tests\DataFixtures\InvoiceTemplateFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse;
/** #[Group('integration')]
* @group integration
*/
class InvoiceControllerTest extends AbstractControllerBaseTestCase class InvoiceControllerTest extends AbstractControllerBaseTestCase
{ {
protected function setUp(): void protected function setUp(): void

View File

@@ -10,11 +10,10 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
/** #[Group('integration')]
* @group integration
*/
class LayoutControllerTest extends AbstractControllerBaseTestCase class LayoutControllerTest extends AbstractControllerBaseTestCase
{ {
public function testNavigationMenus(): void public function testNavigationMenus(): void

View File

@@ -13,10 +13,9 @@ use App\DataFixtures\UserFixtures;
use App\Entity\Role; use App\Entity\Role;
use App\Entity\RolePermission; use App\Entity\RolePermission;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class PermissionControllerTest extends AbstractControllerBaseTestCase class PermissionControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -12,10 +12,9 @@ namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use App\Plugin\PluginManager; use App\Plugin\PluginManager;
use App\Tests\Plugin\Fixtures\TestPlugin\TestPlugin; use App\Tests\Plugin\Fixtures\TestPlugin\TestPlugin;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class PluginControllerTest extends AbstractControllerBaseTestCase class PluginControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -16,13 +16,13 @@ use App\Repository\AccessTokenRepository;
use App\Tests\DataFixtures\TeamFixtures; use App\Tests\DataFixtures\TeamFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\WorkingTime\Mode\WorkingTimeModeDay; use App\WorkingTime\Mode\WorkingTimeModeDay;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\DomCrawler\Field\ChoiceFormField; use Symfony\Component\DomCrawler\Field\ChoiceFormField;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
/** #[Group('integration')]
* @group integration
*/
class ProfileControllerTest extends AbstractControllerBaseTestCase class ProfileControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void
@@ -107,9 +107,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getTabTestData')]
* @dataProvider getTabTestData
*/
public function testEditActionTabs($role, $username): void public function testEditActionTabs($role, $username): void
{ {
$client = $this->getClientForAuthenticatedUser($role); $client = $this->getClientForAuthenticatedUser($role);
@@ -285,9 +283,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
self::assertEquals($code->innerText(), $tokens[1]->getToken()); self::assertEquals($code->innerText(), $tokens[1]->getToken());
} }
/** #[Group('legacy')]
* @group legacy
*/
public function testCreateApiPassword(): void public function testCreateApiPassword(): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
@@ -323,9 +319,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
self::assertTrue($passwordEncoder->getPasswordHasher($user)->verify($user->getApiToken(), 'test1234')); self::assertTrue($passwordEncoder->getPasswordHasher($user)->verify($user->getApiToken(), 'test1234'));
} }
/** #[Group('legacy')]
* @group legacy
*/
public function testCreateApiPasswordFailsIfPasswordLengthToShort(): void public function testCreateApiPasswordFailsIfPasswordLengthToShort(): void
{ {
$this->assertFormHasValidationError( $this->assertFormHasValidationError(
@@ -444,9 +438,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
]; ];
} }
/** #[DataProvider('getPreferencesTestData')]
* @dataProvider getPreferencesTestData
*/
public function testPreferencesAction($role, $username, $hourlyRateOriginal, $hourlyRate, string $expectedLocale, float|null $expectedInternalRate, bool $withRateSettings): void public function testPreferencesAction($role, $username, $hourlyRateOriginal, $hourlyRate, string $expectedLocale, float|null $expectedInternalRate, bool $withRateSettings): void
{ {
$client = $this->getClientForAuthenticatedUser($role); $client = $this->getClientForAuthenticatedUser($role);

View File

@@ -24,13 +24,13 @@ use App\Tests\DataFixtures\TeamFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock; use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\DomCrawler\Field\ChoiceFormField; use Symfony\Component\DomCrawler\Field\ChoiceFormField;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
/** #[Group('integration')]
* @group integration
*/
class ProjectControllerTest extends AbstractControllerBaseTestCase class ProjectControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void
@@ -599,9 +599,7 @@ class ProjectControllerTest extends AbstractControllerBaseTestCase
self::assertFalse($client->getResponse()->isSuccessful()); self::assertFalse($client->getResponse()->isSuccessful());
} }
/** #[DataProvider('getValidationTestData')]
* @dataProvider getValidationTestData
*/
public function testValidationForCreateAction(array $formData, array $validationFields): void public function testValidationForCreateAction(array $formData, array $validationFields): void
{ {
$this->assertFormHasValidationError( $this->assertFormHasValidationError(

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class QuickEntryControllerTest extends AbstractControllerBaseTestCase class QuickEntryControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -12,11 +12,11 @@ namespace App\Tests\Controller\Reporting;
use App\Entity\User; use App\Entity\User;
use App\Tests\Controller\AbstractControllerBaseTestCase; use App\Tests\Controller\AbstractControllerBaseTestCase;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse;
/** #[Group('integration')]
* @group integration
*/
abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBaseTestCase abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBaseTestCase
{ {
protected function importReportingFixture(string $role): void protected function importReportingFixture(string $role): void
@@ -49,9 +49,7 @@ abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBa
]; ];
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testUserPeriodReport(int $user, string $dataType, string $title): void public function testUserPeriodReport(int $user, string $dataType, string $title): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
@@ -64,9 +62,7 @@ abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBa
self::assertEquals($title, $cell->text()); self::assertEquals($title, $cell->text());
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testUserPeriodReportExport(int $user, string $dataType, string $title): void public function testUserPeriodReportExport(int $user, string $dataType, string $title): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);

View File

@@ -12,11 +12,11 @@ namespace App\Tests\Controller\Reporting;
use App\Entity\User; use App\Entity\User;
use App\Tests\Controller\AbstractControllerBaseTestCase; use App\Tests\Controller\AbstractControllerBaseTestCase;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse;
/** #[Group('integration')]
* @group integration
*/
abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerBaseTestCase abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerBaseTestCase
{ {
protected function importReportingFixture(string $role): void protected function importReportingFixture(string $role): void
@@ -49,9 +49,7 @@ abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerB
]; ];
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testUsersPeriodReport(string $dataType, string $title): void public function testUsersPeriodReport(string $dataType, string $title): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
@@ -62,9 +60,7 @@ abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerB
self::assertEquals($title, $cell->text()); self::assertEquals($title, $cell->text());
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testUsersPeriodReportAsTeamlead(string $dataType, string $title): void public function testUsersPeriodReportAsTeamlead(string $dataType, string $title): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
@@ -77,9 +73,7 @@ abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerB
self::assertEquals($title, $cell->text()); self::assertEquals($title, $cell->text());
} }
/** #[DataProvider('getTestData')]
* @dataProvider getTestData
*/
public function testUsersPeriodReportExport(string $dataType, string $title): void public function testUsersPeriodReportExport(string $dataType, string $title): void
{ {
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);

View File

@@ -16,12 +16,11 @@ use App\Tests\DataFixtures\ActivityFixtures;
use App\Tests\DataFixtures\CustomerFixtures; use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\HttpKernelBrowser;
/** #[Group('integration')]
* @group integration
*/
class CustomerMonthlyProjectsControllerTest extends AbstractControllerBaseTestCase class CustomerMonthlyProjectsControllerTest extends AbstractControllerBaseTestCase
{ {
public function testReportIsSecure(): void public function testReportIsSecure(): void

View File

@@ -17,10 +17,9 @@ use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use App\Timesheet\DateTimeFactory; use App\Timesheet\DateTimeFactory;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ProjectDateRangeControllerTest extends AbstractControllerBaseTestCase class ProjectDateRangeControllerTest extends AbstractControllerBaseTestCase
{ {
public function testReportIsSecure(): void public function testReportIsSecure(): void

View File

@@ -15,10 +15,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
use App\Tests\DataFixtures\CustomerFixtures; use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ProjectDetailsControllerTest extends AbstractControllerBaseTestCase class ProjectDetailsControllerTest extends AbstractControllerBaseTestCase
{ {
public function testReportIsSecure(): void public function testReportIsSecure(): void

View File

@@ -15,10 +15,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
use App\Tests\DataFixtures\CustomerFixtures; use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ProjectInactiveControllerTest extends AbstractControllerBaseTestCase class ProjectInactiveControllerTest extends AbstractControllerBaseTestCase
{ {
public function testReportIsSecure(): void public function testReportIsSecure(): void

View File

@@ -15,11 +15,10 @@ use App\Tests\DataFixtures\ActivityFixtures;
use App\Tests\DataFixtures\CustomerFixtures; use App\Tests\DataFixtures\CustomerFixtures;
use App\Tests\DataFixtures\ProjectFixtures; use App\Tests\DataFixtures\ProjectFixtures;
use App\Tests\DataFixtures\TimesheetFixtures; use App\Tests\DataFixtures\TimesheetFixtures;
use PHPUnit\Framework\Attributes\Group;
use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\BinaryFileResponse;
/** #[Group('integration')]
* @group integration
*/
class ProjectViewControllerTest extends AbstractControllerBaseTestCase class ProjectViewControllerTest extends AbstractControllerBaseTestCase
{ {
public function testReportIsSecure(): void public function testReportIsSecure(): void

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class ReportUsersMonthControllerTest extends AbstractUsersPeriodControllerTestCase class ReportUsersMonthControllerTest extends AbstractUsersPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class ReportUsersWeekControllerTest extends AbstractUsersPeriodControllerTestCase class ReportUsersWeekControllerTest extends AbstractUsersPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class ReportUsersYearControllerTest extends AbstractUsersPeriodControllerTestCase class ReportUsersYearControllerTest extends AbstractUsersPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class UserMonthControllerTest extends AbstractUserPeriodControllerTestCase class UserMonthControllerTest extends AbstractUserPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class UserWeekControllerTest extends AbstractUserPeriodControllerTestCase class UserWeekControllerTest extends AbstractUserPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -9,9 +9,9 @@
namespace App\Tests\Controller\Reporting; namespace App\Tests\Controller\Reporting;
/** use PHPUnit\Framework\Attributes\Group;
* @group integration
*/ #[Group('integration')]
class UserYearControllerTest extends AbstractUserPeriodControllerTestCase class UserYearControllerTest extends AbstractUserPeriodControllerTestCase
{ {
protected function getReportUrl(): string protected function getReportUrl(): string

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller; namespace App\Tests\Controller;
use App\Entity\User; use App\Entity\User;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class ReportingControllerTest extends AbstractControllerBaseTestCase class ReportingControllerTest extends AbstractControllerBaseTestCase
{ {
public function testIsSecure(): void public function testIsSecure(): void

View File

@@ -10,10 +10,9 @@
namespace App\Tests\Controller\Security; namespace App\Tests\Controller\Security;
use App\Tests\Controller\AbstractControllerBaseTestCase; use App\Tests\Controller\AbstractControllerBaseTestCase;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('integration')]
* @group integration
*/
class PasswordResetControllerTest extends AbstractControllerBaseTestCase class PasswordResetControllerTest extends AbstractControllerBaseTestCase
{ {
private function testResetActionWithDeactivatedFeature(string $route, string $method = 'GET'): void private function testResetActionWithDeactivatedFeature(string $route, string $method = 'GET'): void

Some files were not shown because too many files have changed in this diff Show More