diff --git a/tests/Doctrine/UserManagerTest.php b/tests/Doctrine/UserManagerTest.php index 49afb33eb..373331c20 100644 --- a/tests/Doctrine/UserManagerTest.php +++ b/tests/Doctrine/UserManagerTest.php @@ -36,10 +36,6 @@ class UserManagerTest extends TestCase protected function setUp(): void { - if (!interface_exists(ObjectManager::class)) { - $this->markTestSkipped('"doctrine/persistence" ^1.3 has to be installed for this test to run.'); - } - $passwordUpdater = $this->getMockBuilder('FOS\UserBundle\Util\PasswordUpdaterInterface')->getMock(); $fieldsUpdater = $this->getMockBuilder('FOS\UserBundle\Util\CanonicalFieldsUpdater') ->disableOriginalConstructor() diff --git a/tests/Security/LoginManagerTest.php b/tests/Security/LoginManagerTest.php index 98e564b01..86879ac00 100644 --- a/tests/Security/LoginManagerTest.php +++ b/tests/Security/LoginManagerTest.php @@ -20,23 +20,18 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Http\RememberMe\RememberMeHandlerInterface; -use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface; class LoginManagerTest extends TestCase { public function testLogInUserWithRequestStack() { - $loginManager = $this->createLoginManager('main'); + $loginManager = $this->createLoginManager(); $loginManager->logInUser('main', $this->mockUser()); } public function testLogInUserWithRememberMeHandler() { - if (!interface_exists(RememberMeHandlerInterface::class)) { - $this->markTestSkipped('This test requires Symfony 5.3+.'); - } - $response = new Response(); $user = $this->mockUser(); @@ -45,35 +40,11 @@ public function testLogInUserWithRememberMeHandler() ->method('createRememberMeCookie') ->with($user); - $loginManager = $this->createLoginManager('main', $rememberMeHandler); + $loginManager = $this->createLoginManager($rememberMeHandler); $loginManager->logInUser('main', $user, $response); } - /** - * @group legacy - */ - public function testLogInUserWithRememberMeService() - { - if (!interface_exists(RememberMeServicesInterface::class)) { - $this->markTestSkipped('This test does not support Symfony 6+.'); - } - - $response = new Response(); - - $rememberMeService = $this->createMock(RememberMeServicesInterface::class); - $rememberMeService - ->expects($this->once()) - ->method('loginSuccess') - ->with($this->isInstanceOf(Request::class), $response, $this->isInstanceOf(TokenInterface::class)); - - $loginManager = $this->createLoginManager('main', $rememberMeService); - $loginManager->logInUser('main', $this->mockUser(), $response); - } - - /** - * @param RememberMeHandlerInterface|RememberMeServicesInterface|null $rememberMeHandler - */ - private function createLoginManager(string $firewallName, $rememberMeHandler = null): LoginManager + private function createLoginManager(?RememberMeHandlerInterface $rememberMeHandler = null): LoginManager { $tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock(); $tokenStorage diff --git a/tests/Util/HashingPasswordUpdaterTest.php b/tests/Util/HashingPasswordUpdaterTest.php index 67cc84a4e..7a710967f 100644 --- a/tests/Util/HashingPasswordUpdaterTest.php +++ b/tests/Util/HashingPasswordUpdaterTest.php @@ -32,10 +32,6 @@ class HashingPasswordUpdaterTest extends TestCase protected function setUp(): void { - if (!interface_exists(PasswordHasherFactoryInterface::class)) { - self::markTestSkipped('This test requires having the password-hasher component.'); - } - $this->passwordHasherFactory = $this->getMockBuilder(PasswordHasherFactoryInterface::class)->getMock(); $this->updater = new HashingPasswordUpdater($this->passwordHasherFactory);