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

@@ -10,14 +10,14 @@
namespace App\Tests\Utils;
use App\Utils\ProfileManager;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage;
/**
* @covers \App\Utils\ProfileManager
*/
#[CoversClass(ProfileManager::class)]
class ProfileManagerTest extends TestCase
{
public function testEmpty(): void
@@ -45,9 +45,7 @@ class ProfileManagerTest extends TestCase
];
}
/**
* @dataProvider getInvalidProfiles
*/
#[DataProvider('getInvalidProfiles')]
public function testIsInvalidProfile(string $profile): void
{
$sut = new ProfileManager();
@@ -68,9 +66,7 @@ class ProfileManagerTest extends TestCase
];
}
/**
* @dataProvider getDatatableNames
*/
#[DataProvider('getDatatableNames')]
public function testDatatableName(string $expected, string $datatable, ?string $prefix): void
{
$sut = new ProfileManager();
@@ -95,9 +91,7 @@ class ProfileManagerTest extends TestCase
];
}
/**
* @dataProvider getProfileNames
*/
#[DataProvider('getProfileNames')]
public function testGetProfile(string $profile, string $expected): void
{
$sut = new ProfileManager();
@@ -136,9 +130,7 @@ class ProfileManagerTest extends TestCase
];
}
/**
* @dataProvider getCookieProfiles
*/
#[DataProvider('getCookieProfiles')]
public function testGetProfileFromCookie(string $cookieValue, string $expected): void
{
$request = new Request();
@@ -165,9 +157,7 @@ class ProfileManagerTest extends TestCase
];
}
/**
* @dataProvider getSessionProfiles
*/
#[DataProvider('getSessionProfiles')]
public function testGetProfileFromSession(string $sessionValue, string $expected): void
{
$request = new Request();