From dac31ad1010924bc2067fbbdaf5c856639c71091 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 25 Jul 2023 11:54:36 +0200 Subject: fix!: Remove legacy event dispatching Symfony's GenericEvent from 2FA Manager Signed-off-by: Joas Schilling --- tests/lib/Authentication/TwoFactorAuth/ManagerTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'tests/lib/Authentication/TwoFactorAuth/ManagerTest.php') diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index da11b11e537..7647e3bda7d 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -40,7 +40,6 @@ use OCP\IUser; use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use function reset; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; class ManagerTest extends TestCase { @@ -84,10 +83,7 @@ class ManagerTest extends TestCase { private $timeFactory; /** @var IEventDispatcher|MockObject */ - private $newDispatcher; - - /** @var EventDispatcherInterface|MockObject */ - private $eventDispatcher; + private $dispatcher; protected function setUp(): void { parent::setUp(); @@ -102,8 +98,7 @@ class ManagerTest extends TestCase { $this->logger = $this->createMock(LoggerInterface::class); $this->tokenProvider = $this->createMock(TokenProvider::class); $this->timeFactory = $this->createMock(ITimeFactory::class); - $this->newDispatcher = $this->createMock(IEventDispatcher::class); - $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class); + $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->manager = new Manager( $this->providerLoader, @@ -115,8 +110,7 @@ class ManagerTest extends TestCase { $this->logger, $this->tokenProvider, $this->timeFactory, - $this->newDispatcher, - $this->eventDispatcher + $this->dispatcher, ); $this->fakeProvider = $this->createMock(IProvider::class); @@ -530,8 +524,7 @@ class ManagerTest extends TestCase { $this->logger, $this->tokenProvider, $this->timeFactory, - $this->newDispatcher, - $this->eventDispatcher + $this->dispatcher, ]) ->setMethods(['loadTwoFactorApp', 'isTwoFactorAuthenticated'])// Do not actually load the apps ->getMock(); -- cgit v1.2.3