summaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-25 15:57:32 +0100
committerGitHub <noreply@github.com>2018-01-25 15:57:32 +0100
commitb9bbb894f8b01e000bb5e3a8a82db7bebad3ea00 (patch)
tree4ac082ef197fdb2a7b6246c2582b63d2ecf70fdb /tests/lib/Authentication
parent8160d0bc2aa334806e6c6e45e4f49bd9cf1a8097 (diff)
parent9e76577ead00471d556c4fcf3534fd17c5b21fec (diff)
downloadnextcloud-server-b9bbb894f8b01e000bb5e3a8a82db7bebad3ea00.tar.gz
nextcloud-server-b9bbb894f8b01e000bb5e3a8a82db7bebad3ea00.zip
Merge pull request #7916 from nextcloud/2fa_log
Add 2FA to logfile
Diffstat (limited to 'tests/lib/Authentication')
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index 9db27edd70c..8afd165f320 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -35,6 +35,7 @@ use OCP\IConfig;
use OCP\ILogger;
use OCP\ISession;
use OCP\IUser;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
class ManagerTest extends TestCase {
@@ -72,6 +73,9 @@ class ManagerTest extends TestCase {
/** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;
+ /** @var EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject */
+ private $eventDispatcher;
+
protected function setUp() {
parent::setUp();
@@ -83,6 +87,7 @@ class ManagerTest extends TestCase {
$this->logger = $this->createMock(ILogger::class);
$this->tokenProvider = $this->createMock(TokenProvider::class);
$this->timeFactory = $this->createMock(ITimeFactory::class);
+ $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
$this->manager = $this->getMockBuilder(Manager::class)
->setConstructorArgs([
@@ -92,7 +97,8 @@ class ManagerTest extends TestCase {
$this->activityManager,
$this->logger,
$this->tokenProvider,
- $this->timeFactory
+ $this->timeFactory,
+ $this->eventDispatcher
])
->setMethods(['loadTwoFactorApp']) // Do not actually load the apps
->getMock();
@@ -301,7 +307,7 @@ class ManagerTest extends TestCase {
->method('setAffectedUser')
->with($this->equalTo('jos'))
->willReturnSelf();
- $this->fakeProvider->expects($this->once())
+ $this->fakeProvider
->method('getDisplayName')
->willReturn('Fake 2FA');
$event->expects($this->once())
@@ -371,7 +377,7 @@ class ManagerTest extends TestCase {
->method('setAffectedUser')
->with($this->equalTo('jos'))
->willReturnSelf();
- $this->fakeProvider->expects($this->once())
+ $this->fakeProvider
->method('getDisplayName')
->willReturn('Fake 2FA');
$event->expects($this->once())
@@ -424,7 +430,8 @@ class ManagerTest extends TestCase {
$this->activityManager,
$this->logger,
$this->tokenProvider,
- $this->timeFactory
+ $this->timeFactory,
+ $this->eventDispatcher
])
->setMethods(['loadTwoFactorApp','isTwoFactorAuthenticated']) // Do not actually load the apps
->getMock();