diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-01-24 08:48:28 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-01-25 13:25:09 +0100 |
commit | c92eff919ea1502d4387ec6deb33956ce6390537 (patch) | |
tree | 5c943f8d20e2933f32738df9eaad53eb91a99ae4 | |
parent | b2ca1d65532a49d13d1727ea837ac13e4f8bfcd6 (diff) | |
download | nextcloud-server-c92eff919ea1502d4387ec6deb33956ce6390537.tar.gz nextcloud-server-c92eff919ea1502d4387ec6deb33956ce6390537.zip |
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | tests/lib/Authentication/TwoFactorAuth/ManagerTest.php | 15 |
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(); |