Skip to content

Commit 3b7d3e7

Browse files
hkdobrevfabpot
authored andcommitted
[PhpUnitBridge] Deprecate @expectedDeprecation annotation
1 parent bdd1db0 commit 3b7d3e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Tests/Authorization/Voter/RoleVoterTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
namespace Symfony\Component\Security\Core\Tests\Authorization\Voter;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1516
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
1617
use Symfony\Component\Security\Core\Authorization\Voter\RoleVoter;
1718
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
1819

1920
class RoleVoterTest extends TestCase
2021
{
22+
use ExpectDeprecationTrait;
23+
2124
/**
2225
* @dataProvider getVoteTests
2326
*/
@@ -46,10 +49,10 @@ public function getVoteTests()
4649

4750
/**
4851
* @group legacy
49-
* @expectedDeprecation Since symfony/security-core 5.1: The ROLE_PREVIOUS_ADMIN role is deprecated and will be removed in version 6.0, use the IS_IMPERSONATOR attribute instead.
5052
*/
5153
public function testDeprecatedRolePreviousAdmin()
5254
{
55+
$this->expectDeprecation('Since symfony/security-core 5.1: The ROLE_PREVIOUS_ADMIN role is deprecated and will be removed in version 6.0, use the IS_IMPERSONATOR attribute instead.');
5356
$voter = new RoleVoter();
5457

5558
$voter->vote($this->getTokenWithRoleNames(['ROLE_USER', 'ROLE_PREVIOUS_ADMIN']), null, ['ROLE_PREVIOUS_ADMIN']);

0 commit comments

Comments
 (0)