replace PHPUnit annotations with attributes (#5608)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user