replace PHPUnit annotations with attributes (#5608)
This commit is contained in:
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Ldap;
|
||||
|
||||
use App\Ldap\FormLoginLdapFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\FormLoginLdapFactory
|
||||
*/
|
||||
#[CoversClass(FormLoginLdapFactory::class)]
|
||||
class FormLoginLdapFactoryTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Ldap;
|
||||
|
||||
use App\Ldap\LdapBadge;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapBadge
|
||||
*/
|
||||
#[CoversClass(LdapBadge::class)]
|
||||
class LdapBadgeTest extends TestCase
|
||||
{
|
||||
public function testMarkResolvedSetsResolvedToTrue(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Ldap;
|
||||
|
||||
use App\Ldap\LdapDriverException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapDriverException
|
||||
*/
|
||||
#[CoversClass(LdapDriverException::class)]
|
||||
class LdapDriverExceptionTest extends TestCase
|
||||
{
|
||||
public function testConstruct(): void
|
||||
|
||||
@@ -17,12 +17,11 @@ use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use App\Tests\Mocks\TestLogger;
|
||||
use Laminas\Ldap\Exception\LdapException;
|
||||
use Laminas\Ldap\Ldap;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LogLevel;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapDriver
|
||||
*/
|
||||
#[CoversClass(LdapDriver::class)]
|
||||
class LdapDriverTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
|
||||
@@ -17,11 +17,12 @@ use App\Ldap\LdapManager;
|
||||
use App\Tests\Configuration\TestConfigLoader;
|
||||
use App\Tests\Mocks\Security\RoleServiceFactory;
|
||||
use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapManager
|
||||
*/
|
||||
#[CoversClass(LdapManager::class)]
|
||||
class LdapManagerTest extends TestCase
|
||||
{
|
||||
protected function getLdapManager(LdapDriver $driver, $roleConfig = null)
|
||||
@@ -388,9 +389,7 @@ class LdapManagerTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidConfigsTestData
|
||||
*/
|
||||
#[DataProvider('getValidConfigsTestData')]
|
||||
public function testUpdateUserOnValidResultWithRolesResult(array $expectedUsers, array $groupConfig, string $expectedGroupQuery): void
|
||||
{
|
||||
$expected = [
|
||||
@@ -583,9 +582,7 @@ class LdapManagerTest extends TestCase
|
||||
$user = $sut->hydrate($ldapEntry);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
#[Group('legacy')]
|
||||
public function testHydrateWithDepercatedSetter(): void
|
||||
{
|
||||
$ldapConfig = [
|
||||
|
||||
@@ -12,13 +12,12 @@ namespace App\Tests\Ldap;
|
||||
use App\Entity\User;
|
||||
use App\Ldap\LdapManager;
|
||||
use App\Ldap\LdapUserProvider;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\LdapUserProvider
|
||||
*/
|
||||
#[CoversClass(LdapUserProvider::class)]
|
||||
class LdapUserProviderTest extends TestCase
|
||||
{
|
||||
public function testLoadUserByIdentifierReturnsNull(): void
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
namespace App\Tests\Ldap;
|
||||
|
||||
use App\Ldap\SanitizingException;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Ldap\SanitizingException
|
||||
*/
|
||||
#[CoversClass(SanitizingException::class)]
|
||||
class SanitizingExceptionTest extends TestCase
|
||||
{
|
||||
public function testMessagesAreSanitized(): void
|
||||
|
||||
Reference in New Issue
Block a user