aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/AppFramework/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/AppFramework/Controller')
-rw-r--r--tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php10
-rw-r--r--tests/lib/AppFramework/Controller/ControllerTest.php2
-rw-r--r--tests/lib/AppFramework/Controller/PublicShareControllerTest.php2
3 files changed, 9 insertions, 5 deletions
diff --git a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
index d6e0321023e..bcc0daf002f 100644
--- a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
+++ b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php
@@ -38,7 +38,7 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
$this->request,
$this->session,
$this->urlGenerator
- ])->setMethods([
+ ])->onlyMethods([
'authFailed',
'getPasswordHash',
'isAuthenticated',
@@ -64,7 +64,9 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
$this->controller->setToken('myToken');
$this->session->method('get')
- ->willReturnMap(['public_link_authenticate_redirect', ['foo' => 'bar']]);
+ ->willReturnMap([
+ ['public_link_authenticate_redirect', json_encode(['foo' => 'bar'])],
+ ]);
$this->urlGenerator->method('linkToRoute')
->willReturn('myLink!');
@@ -107,7 +109,9 @@ class AuthPublicShareControllerTest extends \Test\TestCase {
$this->session->expects($this->once())
->method('regenerateId');
$this->session->method('get')
- ->willReturnMap(['public_link_authenticate_redirect', ['foo' => 'bar']]);
+ ->willReturnMap([
+ ['public_link_authenticate_redirect', json_encode(['foo' => 'bar'])],
+ ]);
$tokenSet = false;
$hashSet = false;
diff --git a/tests/lib/AppFramework/Controller/ControllerTest.php b/tests/lib/AppFramework/Controller/ControllerTest.php
index 7c466e3a5b7..aa016872847 100644
--- a/tests/lib/AppFramework/Controller/ControllerTest.php
+++ b/tests/lib/AppFramework/Controller/ControllerTest.php
@@ -66,7 +66,7 @@ class ControllerTest extends \Test\TestCase {
);
$this->app = $this->getMockBuilder(DIContainer::class)
- ->setMethods(['getAppName'])
+ ->onlyMethods(['getAppName'])
->setConstructorArgs(['test'])
->getMock();
$this->app->expects($this->any())
diff --git a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
index f8430d42ef1..6f0e433f2fb 100644
--- a/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
+++ b/tests/lib/AppFramework/Controller/PublicShareControllerTest.php
@@ -57,7 +57,7 @@ class PublicShareControllerTest extends \Test\TestCase {
$this->assertEquals('test', $controller->getToken());
}
- public function dataIsAuthenticated() {
+ public static function dataIsAuthenticated(): array {
return [
[false, 'token1', 'token1', 'hash1', 'hash1', true],
[false, 'token1', 'token1', 'hash1', 'hash2', true],