From 3c5cf825b396eacdc3e2376137e010552796119e Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 5 Mar 2021 16:02:17 +0100 Subject: Add real events for enabled 2fa providers for users * Shiny new events * Listener to still emit the old event Signed-off-by: Roeland Jago Douma --- tests/lib/Authentication/TwoFactorAuth/ManagerTest.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index a04e0f05f9d..fc921b8016b 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -33,6 +33,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\TwoFactorAuth\IActivatableAtLogin; use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\Authentication\TwoFactorAuth\IRegistry; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\ISession; use OCP\IUser; @@ -83,6 +84,9 @@ class ManagerTest extends TestCase { /** @var ITimeFactory|MockObject */ private $timeFactory; + /** @var IEventDispatcher|MockObject */ + private $newDispatcher; + /** @var EventDispatcherInterface|MockObject */ private $eventDispatcher; @@ -99,6 +103,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->manager = new Manager( @@ -111,6 +116,7 @@ class ManagerTest extends TestCase { $this->logger, $this->tokenProvider, $this->timeFactory, + $this->newDispatcher, $this->eventDispatcher ); @@ -529,6 +535,7 @@ class ManagerTest extends TestCase { $this->logger, $this->tokenProvider, $this->timeFactory, + $this->newDispatcher, $this->eventDispatcher ]) ->setMethods(['loadTwoFactorApp', 'isTwoFactorAuthenticated'])// Do not actually load the apps -- cgit v1.2.3