replace PHPUnit annotations with attributes (#5608)
This commit is contained in:
@@ -14,10 +14,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ActionsControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -21,13 +21,13 @@ use App\Repository\ActivityRateRepository;
|
||||
use App\Repository\ActivityRepository;
|
||||
use App\Repository\Query\VisibilityInterface;
|
||||
use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ActivityControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
use RateControllerTestTrait;
|
||||
@@ -140,9 +140,7 @@ class ActivityControllerTest extends APIControllerBaseTestCase
|
||||
return [$project, $project2, $activity1];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getCollectionTestData
|
||||
*/
|
||||
#[DataProvider('getCollectionTestData')]
|
||||
public function testGetCollection($url, $project, $parameters, $expected): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\API;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ApiDocControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -13,12 +13,11 @@ use App\API\Authentication\AccessTokenHandler;
|
||||
use App\Entity\AccessToken;
|
||||
use App\Entity\User;
|
||||
use App\Repository\AccessTokenRepository;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Authentication\AccessTokenHandler
|
||||
*/
|
||||
#[CoversClass(AccessTokenHandler::class)]
|
||||
class AccessTokenHandlerTest extends TestCase
|
||||
{
|
||||
private function getSut(?AccessToken $accessToken = null): AccessTokenHandler
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace App\Tests\API\Authentication;
|
||||
use App\API\Authentication\TokenAuthenticator;
|
||||
use App\Entity\User;
|
||||
use App\Repository\ApiUserRepository;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
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\Credentials\CustomCredentials;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Authentication\TokenAuthenticator
|
||||
* @group legacy
|
||||
*/
|
||||
#[CoversClass(TokenAuthenticator::class)]
|
||||
#[Group('legacy')]
|
||||
class TokenAuthenticatorTest extends TestCase
|
||||
{
|
||||
private function getSut(bool $verify = true): TokenAuthenticator
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace App\Tests\API;
|
||||
|
||||
use App\DataFixtures\UserFixtures;
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* These tests make sure, that the deprecated API login with X-AUTH-USER and X-AUTH-TOKEN still works.
|
||||
*
|
||||
* @group legacy
|
||||
* @group integration
|
||||
* Make sure that the deprecated API login with X-AUTH-USER and X-AUTH-TOKEN still works.
|
||||
*/
|
||||
#[Group('legacy')]
|
||||
#[Group('integration')]
|
||||
class AuthenticationTest extends APIControllerBaseTestCase
|
||||
{
|
||||
public function testPinIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\API;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ConfigurationControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
public function testIsTimesheetSecure(): void
|
||||
|
||||
@@ -21,13 +21,12 @@ use App\Entity\User;
|
||||
use App\Repository\CustomerRateRepository;
|
||||
use App\Repository\CustomerRepository;
|
||||
use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class CustomerControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
use RateControllerTestTrait;
|
||||
|
||||
@@ -12,12 +12,11 @@ namespace App\Tests\API;
|
||||
use App\Entity\ExportTemplate;
|
||||
use App\Entity\User;
|
||||
use App\Repository\ExportTemplateRepository;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ExportControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
private function importExportTemplate(): ExportTemplate
|
||||
|
||||
@@ -12,10 +12,9 @@ namespace App\Tests\API;
|
||||
use App\Entity\Invoice;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\InvoiceFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class InvoiceControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\API\Model;
|
||||
|
||||
use App\API\Model\PageAction;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Model\PageAction
|
||||
*/
|
||||
#[CoversClass(PageAction::class)]
|
||||
class PageActionTest extends TestCase
|
||||
{
|
||||
public function testEmptySettings(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\API\Model;
|
||||
|
||||
use App\API\Model\TimesheetConfig;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Model\TimesheetConfig
|
||||
*/
|
||||
#[CoversClass(TimesheetConfig::class)]
|
||||
class TimesheetConfigTest extends TestCase
|
||||
{
|
||||
public function testSetter(): void
|
||||
|
||||
@@ -11,11 +11,10 @@ namespace App\Tests\API\Model;
|
||||
|
||||
use App\API\Model\Version;
|
||||
use App\Constants;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Model\Version
|
||||
*/
|
||||
#[CoversClass(Version::class)]
|
||||
class VersionTest extends TestCase
|
||||
{
|
||||
public function testValues(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\API;
|
||||
|
||||
use App\API\NotFoundException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\API\NotFoundException
|
||||
*/
|
||||
#[CoversClass(NotFoundException::class)]
|
||||
class NotFoundExceptionTest extends TestCase
|
||||
{
|
||||
public function testConstructor(): void
|
||||
|
||||
@@ -21,13 +21,13 @@ use App\Repository\ProjectRateRepository;
|
||||
use App\Repository\ProjectRepository;
|
||||
use App\Repository\Query\VisibilityInterface;
|
||||
use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
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
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -15,6 +15,7 @@ use FOS\RestBundle\Serializer\Normalizer\FlattenExceptionHandler;
|
||||
use JMS\Serializer\GraphNavigatorInterface;
|
||||
use JMS\Serializer\JsonSerializationVisitor;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
@@ -22,9 +23,7 @@ use Symfony\Component\Validator\ConstraintViolation;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\API\Serializer\ValidationFailedExceptionErrorHandler
|
||||
*/
|
||||
#[CoversClass(ValidationFailedExceptionErrorHandler::class)]
|
||||
class ValidationFailedExceptionErrorHandlerTest extends TestCase
|
||||
{
|
||||
public function testSubscribingMethods(): void
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\API;
|
||||
|
||||
use App\Constants;
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class StatusControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecurePing(): void
|
||||
|
||||
@@ -12,11 +12,10 @@ namespace App\Tests\API;
|
||||
use App\Entity\Tag;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TagFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TagControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -13,11 +13,11 @@ use App\Entity\Team;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TeamFixtures;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TeamControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
/**
|
||||
@@ -47,9 +47,7 @@ class TeamControllerTest extends APIControllerBaseTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getRoleTestData
|
||||
*/
|
||||
#[DataProvider('getRoleTestData')]
|
||||
public function testIsSecureForRole(string $role): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole($role, '/api/teams');
|
||||
|
||||
@@ -20,12 +20,12 @@ use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\TimesheetTestMetaFieldSubscriberMock;
|
||||
use App\Timesheet\DateTimeFactory;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TimesheetControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
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
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
namespace App\Tests\API;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class UserControllerTest extends APIControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -33,9 +33,7 @@ class UserControllerTest extends APIControllerBaseTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getRoleTestData
|
||||
*/
|
||||
#[DataProvider('getRoleTestData')]
|
||||
public function testIsSecureForRole(string $role): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole($role, '/api/users');
|
||||
|
||||
@@ -21,15 +21,15 @@ use App\Event\ActivityUpdatePreEvent;
|
||||
use App\Repository\ActivityRepository;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use App\Validator\ValidationFailedException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Validator\ConstraintViolation;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Activity\ActivityService
|
||||
*/
|
||||
#[CoversClass(ActivityService::class)]
|
||||
class ActivityServiceTest extends TestCase
|
||||
{
|
||||
private function getSut(
|
||||
@@ -144,9 +144,7 @@ class ActivityServiceTest extends TestCase
|
||||
self::assertNull($project->getProject());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testActivityNumber(string $format, int|string $expected): void
|
||||
{
|
||||
$sut = $this->getSut(null, null, null, ['number_format' => $format]);
|
||||
|
||||
@@ -11,11 +11,10 @@ namespace App\Tests\Calendar;
|
||||
|
||||
use App\Calendar\CalendarSource;
|
||||
use App\Calendar\CalendarSourceType;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Calendar\CalendarSource
|
||||
*/
|
||||
#[CoversClass(CalendarSource::class)]
|
||||
class CalendarSourceTest extends TestCase
|
||||
{
|
||||
public function testSource(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Calendar;
|
||||
|
||||
use App\Calendar\GoogleSource;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Calendar\GoogleSource
|
||||
*/
|
||||
#[CoversClass(GoogleSource::class)]
|
||||
class GoogleSourceTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -11,11 +11,10 @@ namespace App\Tests\Calendar;
|
||||
|
||||
use App\Calendar\Google;
|
||||
use App\Calendar\GoogleSource;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Calendar\Google
|
||||
*/
|
||||
#[CoversClass(Google::class)]
|
||||
class GoogleTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -12,11 +12,10 @@ namespace App\Tests\Calendar;
|
||||
use App\Calendar\RecentActivitiesSource;
|
||||
use App\Calendar\TimesheetEntry;
|
||||
use App\Entity\Timesheet;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Calendar\RecentActivitiesSource
|
||||
*/
|
||||
#[CoversClass(RecentActivitiesSource::class)]
|
||||
class RecentActivitiesSourceTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -14,11 +14,10 @@ use App\Entity\Activity;
|
||||
use App\Entity\Project;
|
||||
use App\Entity\Tag;
|
||||
use App\Entity\Timesheet;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Calendar\TimesheetEntry
|
||||
*/
|
||||
#[CoversClass(TimesheetEntry::class)]
|
||||
class TimesheetEntryTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -14,15 +14,15 @@ use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ActivateUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ActivateUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ActivateUserCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\AbstractBundleInstallerCommand;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
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\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\AbstractBundleInstallerCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(AbstractBundleInstallerCommand::class)]
|
||||
#[Group('integration')]
|
||||
class BundleInstallerCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -9,22 +9,23 @@
|
||||
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\AbstractUserCommand;
|
||||
use App\Command\ChangePasswordCommand;
|
||||
use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ChangePasswordCommand
|
||||
* @covers \App\Command\AbstractUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ChangePasswordCommand::class)]
|
||||
#[CoversClass(AbstractUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ChangePasswordCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -14,14 +14,14 @@ use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\CreateUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(CreateUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class CreateUserCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -14,15 +14,15 @@ use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\DeactivateUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(DeactivateUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class DeactivateUserCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -9,21 +9,22 @@
|
||||
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\AbstractRoleCommand;
|
||||
use App\Command\DemoteUserCommand;
|
||||
use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\AbstractRoleCommand
|
||||
* @covers \App\Command\DemoteUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(AbstractRoleCommand::class)]
|
||||
#[CoversClass(DemoteUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class DemoteUserCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -23,16 +23,16 @@ use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\KernelTestTrait;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ExportCreateCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ExportCreateCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ExportCreateCommandTest extends KernelTestCase
|
||||
{
|
||||
use KernelTestTrait;
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\InstallCommand;
|
||||
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\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\InstallCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(InstallCommand::class)]
|
||||
#[Group('integration')]
|
||||
class InstallCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -23,14 +23,14 @@ use App\Tests\DataFixtures\InvoiceTemplateFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\KernelTestTrait;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\InvoiceCreateCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(InvoiceCreateCommand::class)]
|
||||
#[Group('integration')]
|
||||
class InvoiceCreateCommandTest extends KernelTestCase
|
||||
{
|
||||
use KernelTestTrait;
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\ListUserCommand;
|
||||
use App\Repository\UserRepository;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ListUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ListUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ListUserCommandTest extends KernelTestCase
|
||||
{
|
||||
public function testWithPlugins(): void
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\MailTestCommand;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Psr\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\MailTestCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(MailTestCommand::class)]
|
||||
#[Group('integration')]
|
||||
class MailTestCommandTest extends KernelTestCase
|
||||
{
|
||||
protected Application $application;
|
||||
|
||||
@@ -13,14 +13,14 @@ use App\Command\PluginCommand;
|
||||
use App\Plugin\PackageManager;
|
||||
use App\Plugin\PluginInterface;
|
||||
use App\Plugin\PluginManager;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\PluginCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(PluginCommand::class)]
|
||||
#[Group('integration')]
|
||||
class PluginCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -9,21 +9,22 @@
|
||||
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\AbstractRoleCommand;
|
||||
use App\Command\PromoteUserCommand;
|
||||
use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use App\User\UserService;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\AbstractRoleCommand
|
||||
* @covers \App\Command\PromoteUserCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(AbstractRoleCommand::class)]
|
||||
#[CoversClass(PromoteUserCommand::class)]
|
||||
#[Group('integration')]
|
||||
class PromoteUserCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\ReloadCommand;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ReloadCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ReloadCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ReloadCommandTest extends KernelTestCase
|
||||
{
|
||||
protected Application $application;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
namespace App\Tests\Command;
|
||||
|
||||
use App\Command\ResetDevelopmentCommand;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ResetDevelopmentCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ResetDevelopmentCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ResetDevelopmentCommandTest extends KernelTestCase
|
||||
{
|
||||
public function testCommandName(): void
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\ResetTestCommand;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ResetTestCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(ResetTestCommand::class)]
|
||||
#[Group('integration')]
|
||||
class ResetTestCommandTest extends KernelTestCase
|
||||
{
|
||||
public function testCommandName(): void
|
||||
|
||||
@@ -11,14 +11,14 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\TimesheetStopAllCommand;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\TimesheetStopAllCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(TimesheetStopAllCommand::class)]
|
||||
#[Group('integration')]
|
||||
class TimesheetStopAllCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -11,15 +11,15 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\UserLoginLinkCommand;
|
||||
use App\Repository\UserRepository;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\UserLoginLinkCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(UserLoginLinkCommand::class)]
|
||||
#[Group('integration')]
|
||||
class UserLoginLinkCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
|
||||
@@ -11,14 +11,15 @@ namespace App\Tests\Command;
|
||||
|
||||
use App\Command\VersionCommand;
|
||||
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\Test\KernelTestCase;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\VersionCommand
|
||||
* @group integration
|
||||
*/
|
||||
#[CoversClass(VersionCommand::class)]
|
||||
#[Group('integration')]
|
||||
class VersionCommandTest extends KernelTestCase
|
||||
{
|
||||
private Application $application;
|
||||
@@ -32,9 +33,7 @@ class VersionCommandTest extends KernelTestCase
|
||||
$this->application->add(new VersionCommand());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testVersion(array $options, $result): void
|
||||
{
|
||||
$commandTester = $this->getCommandTester($options);
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
namespace App\Tests\Configuration;
|
||||
|
||||
use App\Configuration\LdapConfiguration;
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\LdapConfiguration
|
||||
* @covers \App\Configuration\SystemConfiguration
|
||||
*/
|
||||
#[CoversClass(LdapConfiguration::class)]
|
||||
#[CoversClass(SystemConfiguration::class)]
|
||||
class LdapConfigurationTest extends TestCase
|
||||
{
|
||||
protected function getSut(array $settings)
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
namespace App\Tests\Configuration;
|
||||
|
||||
use App\Configuration\LocaleService;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\LocaleService
|
||||
*/
|
||||
#[CoversClass(LocaleService::class)]
|
||||
class LocaleServiceTest extends TestCase
|
||||
{
|
||||
protected function getSut(array $settings): LocaleService
|
||||
@@ -146,9 +146,7 @@ class LocaleServiceTest extends TestCase
|
||||
self::assertEquals('H:i:s', $sut->getTimeFormat('en'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getNearestTranslationLocaleData
|
||||
*/
|
||||
#[DataProvider('getNearestTranslationLocaleData')]
|
||||
public function testGetNearestTranslationLocale(string $locale, string $expected): void
|
||||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings());
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Configuration;
|
||||
|
||||
use App\Configuration\MailConfiguration;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\MailConfiguration
|
||||
*/
|
||||
#[CoversClass(MailConfiguration::class)]
|
||||
class MailConfigurationTest extends TestCase
|
||||
{
|
||||
public function testGetFromAddress(): void
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
namespace App\Tests\Configuration;
|
||||
|
||||
use App\Configuration\SamlConfiguration;
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\SamlConfiguration
|
||||
* @covers \App\Configuration\SystemConfiguration
|
||||
*/
|
||||
#[CoversClass(SamlConfiguration::class)]
|
||||
#[CoversClass(SystemConfiguration::class)]
|
||||
class SamlConfigurationTest extends TestCase
|
||||
{
|
||||
protected function getSut(array $settings)
|
||||
|
||||
@@ -12,11 +12,10 @@ namespace App\Tests\Configuration;
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Entity\Configuration;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\SystemConfiguration
|
||||
*/
|
||||
#[CoversClass(SystemConfiguration::class)]
|
||||
class SystemConfigurationTest extends TestCase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -11,12 +11,11 @@ namespace App\Tests;
|
||||
|
||||
use App\ConsoleApplication;
|
||||
use App\Constants;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\ConsoleApplication
|
||||
*/
|
||||
#[CoversClass(ConsoleApplication::class)]
|
||||
class ConsoleApplicationTest extends TestCase
|
||||
{
|
||||
public function testVersion(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests;
|
||||
|
||||
use App\Constants;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Constants
|
||||
*/
|
||||
#[CoversClass(Constants::class)]
|
||||
class ConstantsTest extends TestCase
|
||||
{
|
||||
public function testBuild(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class AboutControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIndexAction(): void
|
||||
|
||||
@@ -19,13 +19,13 @@ use App\Tests\DataFixtures\TeamFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\ActivityTestMetaFieldSubscriberMock;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ActivityControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -427,9 +427,7 @@ class ActivityControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
#[DataProvider('getValidationTestData')]
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields): void
|
||||
{
|
||||
$this->assertFormHasValidationError(
|
||||
|
||||
@@ -19,15 +19,14 @@ use App\Tests\Mocks\Saml\SamlAuthFactoryFactory;
|
||||
use App\Tests\Mocks\SecurityFactory;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use OneLogin\Saml2\Auth;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\Security\Http\SecurityRequestAttributes;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class SamlControllerTest extends TestCase
|
||||
{
|
||||
protected function getSystemConfigurationMock(array $settings, array $loaderSettings = []): SystemConfiguration
|
||||
|
||||
@@ -14,10 +14,9 @@ use App\Entity\User;
|
||||
use App\Tests\Configuration\TestConfigLoader;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class CalendarControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ContractControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -20,13 +20,13 @@ use App\Tests\DataFixtures\TeamFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\CustomerTestMetaFieldSubscriberMock;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class CustomerControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -513,9 +513,7 @@ class CustomerControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
#[DataProvider('getValidationTestData')]
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields): void
|
||||
{
|
||||
$this->assertFormHasValidationError(
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class DashboardControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class DoctorControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testDoctorIsSecure(): void
|
||||
|
||||
@@ -16,11 +16,10 @@ use App\Entity\User;
|
||||
use App\Tests\DataFixtures\ExportTemplateFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\DomCrawler\Field\FormField;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ExportControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class FavoriteControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class HelpControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testHelpLocalesAction(): void
|
||||
|
||||
@@ -12,10 +12,9 @@ namespace App\Tests\Controller;
|
||||
use App\Entity\User;
|
||||
use App\Entity\UserPreference;
|
||||
use App\Form\Type\InitialViewType;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class HomepageControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -15,11 +15,10 @@ use App\Entity\Timesheet;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\InvoiceTemplateFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class InvoiceControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class LayoutControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testNavigationMenus(): void
|
||||
|
||||
@@ -13,10 +13,9 @@ use App\DataFixtures\UserFixtures;
|
||||
use App\Entity\Role;
|
||||
use App\Entity\RolePermission;
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class PermissionControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -12,10 +12,9 @@ namespace App\Tests\Controller;
|
||||
use App\Entity\User;
|
||||
use App\Plugin\PluginManager;
|
||||
use App\Tests\Plugin\Fixtures\TestPlugin\TestPlugin;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class PluginControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -16,13 +16,13 @@ use App\Repository\AccessTokenRepository;
|
||||
use App\Tests\DataFixtures\TeamFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\WorkingTime\Mode\WorkingTimeModeDay;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProfileControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -107,9 +107,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTabTestData
|
||||
*/
|
||||
#[DataProvider('getTabTestData')]
|
||||
public function testEditActionTabs($role, $username): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser($role);
|
||||
@@ -285,9 +283,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertEquals($code->innerText(), $tokens[1]->getToken());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
#[Group('legacy')]
|
||||
public function testCreateApiPassword(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
@@ -323,9 +319,7 @@ class ProfileControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertTrue($passwordEncoder->getPasswordHasher($user)->verify($user->getApiToken(), 'test1234'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
#[Group('legacy')]
|
||||
public function testCreateApiPasswordFailsIfPasswordLengthToShort(): void
|
||||
{
|
||||
$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
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser($role);
|
||||
|
||||
@@ -24,13 +24,13 @@ use App\Tests\DataFixtures\TeamFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\ProjectTestMetaFieldSubscriberMock;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\DomCrawler\Field\ChoiceFormField;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -599,9 +599,7 @@ class ProjectControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
#[DataProvider('getValidationTestData')]
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields): void
|
||||
{
|
||||
$this->assertFormHasValidationError(
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class QuickEntryControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace App\Tests\Controller\Reporting;
|
||||
use App\Entity\User;
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBaseTestCase
|
||||
{
|
||||
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
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
@@ -64,9 +62,7 @@ abstract class AbstractUserPeriodControllerTestCase extends AbstractControllerBa
|
||||
self::assertEquals($title, $cell->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testUserPeriodReportExport(int $user, string $dataType, string $title): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
|
||||
@@ -12,11 +12,11 @@ namespace App\Tests\Controller\Reporting;
|
||||
use App\Entity\User;
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerBaseTestCase
|
||||
{
|
||||
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
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
@@ -62,9 +60,7 @@ abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerB
|
||||
self::assertEquals($title, $cell->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testUsersPeriodReportAsTeamlead(string $dataType, string $title): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
@@ -77,9 +73,7 @@ abstract class AbstractUsersPeriodControllerTestCase extends AbstractControllerB
|
||||
self::assertEquals($title, $cell->text());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testUsersPeriodReportExport(string $dataType, string $title): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
|
||||
@@ -16,12 +16,11 @@ use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class CustomerMonthlyProjectsControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testReportIsSecure(): void
|
||||
|
||||
@@ -17,10 +17,9 @@ use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Timesheet\DateTimeFactory;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectDateRangeControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testReportIsSecure(): void
|
||||
|
||||
@@ -15,10 +15,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectDetailsControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testReportIsSecure(): void
|
||||
|
||||
@@ -15,10 +15,9 @@ use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectInactiveControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testReportIsSecure(): void
|
||||
|
||||
@@ -15,11 +15,10 @@ use App\Tests\DataFixtures\ActivityFixtures;
|
||||
use App\Tests\DataFixtures\CustomerFixtures;
|
||||
use App\Tests\DataFixtures\ProjectFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ProjectViewControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testReportIsSecure(): void
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class ReportUsersMonthControllerTest extends AbstractUsersPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class ReportUsersWeekControllerTest extends AbstractUsersPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class ReportUsersYearControllerTest extends AbstractUsersPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class UserMonthControllerTest extends AbstractUserPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class UserWeekControllerTest extends AbstractUserPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
namespace App\Tests\Controller\Reporting;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
#[Group('integration')]
|
||||
class UserYearControllerTest extends AbstractUserPeriodControllerTestCase
|
||||
{
|
||||
protected function getReportUrl(): string
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class ReportingControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller\Security;
|
||||
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class PasswordResetControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
private function testResetActionWithDeactivatedFeature(string $route, string $method = 'GET'): void
|
||||
|
||||
@@ -16,14 +16,14 @@ use App\DataFixtures\UserFixtures;
|
||||
use App\Entity\User;
|
||||
use App\Tests\Configuration\TestConfigLoader;
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
||||
|
||||
/**
|
||||
* This test makes sure the login and registration work as expected.
|
||||
* The logic is located in the FOSUserBundle and already tested, but we use a different layout.
|
||||
*
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class SecurityControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testRootUrlIsRedirectedToLogin(): void
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace App\Tests\Controller\Security;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Tests\Controller\AbstractControllerBaseTestCase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class SelfRegistrationControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
private function assertRegisterActionWithDeactivatedFeature(string $route): void
|
||||
@@ -163,9 +163,7 @@ class SelfRegistrationControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertTrue($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
#[DataProvider('getValidationTestData')]
|
||||
public function testRegisterActionWithValidationProblems(array $formData, array $validationFields): void
|
||||
{
|
||||
$client = self::createClient();
|
||||
|
||||
@@ -11,10 +11,9 @@ namespace App\Tests\Controller;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class SystemConfigurationControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -12,10 +12,9 @@ namespace App\Tests\Controller;
|
||||
use App\Entity\Tag;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TagFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TagControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,10 @@ namespace App\Tests\Controller;
|
||||
use App\Entity\Team;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TeamFixtures;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TeamControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -20,11 +20,11 @@ use App\Tests\DataFixtures\TagFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Tests\Mocks\TimesheetTestMetaFieldSubscriberMock;
|
||||
use App\Timesheet\DateTimeFactory;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TimesheetControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -225,9 +225,7 @@ class TimesheetControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertNull($timesheet->getFixedRate());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestDataForDurationValues
|
||||
*/
|
||||
#[DataProvider('getTestDataForDurationValues')]
|
||||
public function testCreateActionWithDurationValues($beginDate, $beginTime, $end, $duration, $expectedDuration, $expectedEnd): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser();
|
||||
@@ -322,9 +320,7 @@ class TimesheetControllerTest extends AbstractControllerBaseTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTrackingModeTestData
|
||||
*/
|
||||
#[DataProvider('getTrackingModeTestData')]
|
||||
public function testCreateActionWithTrackingModeHasFieldsForUser(string $trackingMode, string $user, bool $showBeginTime, bool $showEndTime): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser($user);
|
||||
|
||||
@@ -17,10 +17,9 @@ use App\Tests\DataFixtures\TagFixtures;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use App\Timesheet\DateTimeFactory;
|
||||
use App\Timesheet\Util;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class TimesheetTeamControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -12,10 +12,10 @@ namespace App\Tests\Controller;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Entity\User;
|
||||
use App\Tests\DataFixtures\TimesheetFixtures;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class UserControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
@@ -219,9 +219,7 @@ class UserControllerTest extends AbstractControllerBaseTestCase
|
||||
self::assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
#[DataProvider('getValidationTestData')]
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields): void
|
||||
{
|
||||
$this->assertFormHasValidationError(
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class WidgetControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testIsSecure(): void
|
||||
|
||||
@@ -10,10 +10,9 @@
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
*/
|
||||
#[Group('integration')]
|
||||
class WizardControllerTest extends AbstractControllerBaseTestCase
|
||||
{
|
||||
public function testUnknownWizard(): void
|
||||
|
||||
@@ -21,15 +21,15 @@ use App\Event\CustomerUpdatePreEvent;
|
||||
use App\Repository\CustomerRepository;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use App\Validator\ValidationFailedException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Validator\ConstraintViolation;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Customer\CustomerService
|
||||
*/
|
||||
#[CoversClass(CustomerService::class)]
|
||||
class CustomerServiceTest extends TestCase
|
||||
{
|
||||
private function getSut(
|
||||
@@ -142,9 +142,7 @@ class CustomerServiceTest extends TestCase
|
||||
$sut->saveCustomer($Customer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTestData
|
||||
*/
|
||||
#[DataProvider('getTestData')]
|
||||
public function testCustomerNumber(string $format, int|string $expected): void
|
||||
{
|
||||
$configuration = SystemConfigurationFactory::createStub([
|
||||
|
||||
@@ -11,12 +11,11 @@ namespace App\Tests\DependencyInjection;
|
||||
|
||||
use App\DependencyInjection\AppExtension;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* @covers \App\DependencyInjection\AppExtension
|
||||
*/
|
||||
#[CoversClass(AppExtension::class)]
|
||||
class AppExtensionTest extends TestCase
|
||||
{
|
||||
private ?AppExtension $extension = null;
|
||||
|
||||
@@ -19,13 +19,12 @@ use App\Export\RendererInterface;
|
||||
use App\Export\ServiceExport;
|
||||
use App\Export\TimesheetExportInterface;
|
||||
use App\Export\TimesheetExportRepository;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
/**
|
||||
* @covers \App\DependencyInjection\Compiler\ExportServiceCompilerPass
|
||||
*/
|
||||
#[CoversClass(ExportServiceCompilerPass::class)]
|
||||
class ExportServiceCompilerPassTest extends TestCase
|
||||
{
|
||||
private function getContainer(): ContainerBuilder
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user