Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-05 18:02:17 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-22 22:57:10 +0300
commit3c5cf825b396eacdc3e2376137e010552796119e (patch)
tree4454b1c5264908a0dc65e6d31d786a87b335577e /tests
parent90909ab9b9f2263e854788802794007a6d766356 (diff)
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 <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php7
1 files changed, 7 insertions, 0 deletions
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