Skip to content

Commit 68ebebf

Browse files
committed
replace expectDeprecation() with expectUserDeprecationMessage()
1 parent 7929409 commit 68ebebf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Tests/Authentication/Token/AbstractTokenTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
namespace Symfony\Component\Security\Core\Tests\Authentication\Token;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
1717
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1818
use Symfony\Component\Security\Core\User\InMemoryUser;
1919
use Symfony\Component\Security\Core\User\UserInterface;
2020

2121
class AbstractTokenTest extends TestCase
2222
{
23-
use ExpectDeprecationTrait;
23+
use ExpectUserDeprecationMessageTrait;
2424

2525
/**
2626
* @dataProvider provideUsers
@@ -48,7 +48,7 @@ public function testEraseCredentials()
4848
$user->expects($this->once())->method('eraseCredentials');
4949
$token->setUser($user);
5050

51-
$this->expectDeprecation(\sprintf('Since symfony/security-core 7.3: The "%s::eraseCredentials()" method is deprecated and will be removed in 8.0, erase credentials using the "__serialize()" method instead.', TokenInterface::class));
51+
$this->expectUserDeprecationMessage(\sprintf('Since symfony/security-core 7.3: The "%s::eraseCredentials()" method is deprecated and will be removed in 8.0, erase credentials using the "__serialize()" method instead.', TokenInterface::class));
5252

5353
$token->eraseCredentials();
5454
}

Tests/User/InMemoryUserTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
namespace Symfony\Component\Security\Core\Tests\User;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1616
use Symfony\Component\Security\Core\User\InMemoryUser;
1717
use Symfony\Component\Security\Core\User\UserInterface;
1818

1919
class InMemoryUserTest extends TestCase
2020
{
21-
use ExpectDeprecationTrait;
21+
use ExpectUserDeprecationMessageTrait;
2222

2323
public function testConstructorException()
2424
{
@@ -62,7 +62,7 @@ public function testIsEnabled()
6262
public function testEraseCredentials()
6363
{
6464
$user = new InMemoryUser('fabien', 'superpass');
65-
$this->expectDeprecation(\sprintf('%sMethod %s::eraseCredentials() is deprecated since symfony/security-core 7.3', \PHP_VERSION_ID >= 80400 ? 'Unsilenced deprecation: ' : '', InMemoryUser::class));
65+
$this->expectUserDeprecationMessage(\sprintf('%sMethod %s::eraseCredentials() is deprecated since symfony/security-core 7.3', \PHP_VERSION_ID >= 80400 ? 'Unsilenced deprecation: ' : '', InMemoryUser::class));
6666
$user->eraseCredentials();
6767
$this->assertEquals('superpass', $user->getPassword());
6868
}

0 commit comments

Comments
 (0)