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/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-20 18:18:15 +0300
committerJoas Schilling <coding@schilljs.com>2021-04-20 18:18:15 +0300
commitfe8d98f84b36325ccf02dc0cdc85872ddbb4e5d0 (patch)
tree8378da394317eb22a99ea9453ecef06ad961f2b3 /apps
parent94322971a5a052becb92d4f81a158fd1cf43c873 (diff)
Fix twofactor backup code tests
16) OCA\TwoFactorBackupCodes\Tests\Unit\Listener\ActivityPublisherTest::testHandleCodesGeneratedEvent Method publish may not return value of type Mock_IEvent_11bf8381, its return declaration is ": void" 17) OCA\TwoFactorBackupCodes\Tests\Unit\Controller\SettingsControllerTest::testCreateCodes Method getBackupCodesState may not return value of type string, its return declaration is ": array" Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php4
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php3
2 files changed, 3 insertions, 4 deletions
diff --git a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
index db048a42749..e74f08043f7 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
@@ -75,11 +75,11 @@ class SettingsControllerTest extends TestCase {
$this->storage->expects($this->once())
->method('getBackupCodesState')
->with($user)
- ->willReturn('state');
+ ->willReturn(['state']);
$expected = [
'codes' => $codes,
- 'state' => 'state',
+ 'state' => ['state'],
];
$response = $this->controller->createCodes();
$this->assertInstanceOf(JSONResponse::class, $response);
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
index 4a32faf0f67..4d93110514a 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
@@ -89,8 +89,7 @@ class ActivityPublisherTest extends TestCase {
->with('fritz')
->willReturnSelf();
$this->activityManager->expects($this->once())
- ->method('publish')
- ->willReturn($activityEvent);
+ ->method('publish');
$this->listener->handle($event);
}