Skip to content

Commit 29b8dcb

Browse files
committed
Mark the old password updater tests as legacy
This implementation relies on the old deprecated API of the encoders, so it might trigger deprecation warnings when testing it.
1 parent 8e92dfa commit 29b8dcb

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Tests/Util/PasswordUpdaterTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,28 @@
1313

1414
use FOS\UserBundle\Tests\TestUser;
1515
use FOS\UserBundle\Util\PasswordUpdater;
16+
use PHPUnit\Framework\MockObject\MockObject;
1617
use PHPUnit\Framework\TestCase;
18+
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
1719

20+
/**
21+
* @group legacy
22+
*/
1823
class PasswordUpdaterTest extends TestCase
1924
{
2025
/**
21-
* @var PasswordUpdater
26+
* @var PasswordUpdater&MockObject
2227
*/
2328
private $updater;
2429
private $encoderFactory;
2530

2631
protected function setUp(): void
2732
{
28-
$this->encoderFactory = $this->getMockBuilder('Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface')->getMock();
33+
if (!interface_exists(EncoderFactoryInterface::class)) {
34+
$this->markTestSkipped('The PasswordUpdater class does not support Symfony 6+.');
35+
}
36+
37+
$this->encoderFactory = $this->getMockBuilder(EncoderFactoryInterface::class)->getMock();
2938

3039
$this->updater = new PasswordUpdater($this->encoderFactory);
3140
}

0 commit comments

Comments
 (0)