aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php')
-rw-r--r--apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php b/apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php
index 5ba21255a8d..631b6a0f51c 100644
--- a/apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/ShareInfoMiddlewareTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -11,6 +12,7 @@ use OCA\Files_Sharing\Middleware\ShareInfoMiddleware;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
+use OCP\AppFramework\Http\Response;
use OCP\Share\IManager as ShareManager;
use Test\TestCase;
@@ -29,14 +31,14 @@ class ShareInfoMiddlewareTest extends TestCase {
$this->middleware = new ShareInfoMiddleware($this->shareManager);
}
- public function testBeforeControllerNoShareInfo() {
+ public function testBeforeControllerNoShareInfo(): void {
$this->shareManager->expects($this->never())
->method($this->anything());
$this->middleware->beforeController($this->createMock(ShareInfoMiddlewareTestController::class), 'foo');
}
- public function testBeforeControllerShareInfoNoS2s() {
+ public function testBeforeControllerShareInfoNoS2s(): void {
$this->shareManager->expects($this->once())
->method('outgoingServer2ServerSharesAllowed')
->willReturn(false);
@@ -45,7 +47,7 @@ class ShareInfoMiddlewareTest extends TestCase {
$this->middleware->beforeController($this->createMock(ShareInfoController::class), 'foo');
}
- public function testBeforeControllerShareInfo() {
+ public function testBeforeControllerShareInfo(): void {
$this->shareManager->expects($this->once())
->method('outgoingServer2ServerSharesAllowed')
->willReturn(true);
@@ -53,7 +55,7 @@ class ShareInfoMiddlewareTest extends TestCase {
$this->middleware->beforeController($this->createMock(ShareInfoController::class), 'foo');
}
- public function testAfterExceptionNoShareInfo() {
+ public function testAfterExceptionNoShareInfo(): void {
$exeption = new \Exception();
try {
@@ -65,7 +67,7 @@ class ShareInfoMiddlewareTest extends TestCase {
}
- public function testAfterExceptionNoS2S() {
+ public function testAfterExceptionNoS2S(): void {
$exeption = new \Exception();
try {
@@ -76,7 +78,7 @@ class ShareInfoMiddlewareTest extends TestCase {
}
}
- public function testAfterExceptionS2S() {
+ public function testAfterExceptionS2S(): void {
$expected = new JSONResponse([], Http::STATUS_NOT_FOUND);
$this->assertEquals(
@@ -85,8 +87,8 @@ class ShareInfoMiddlewareTest extends TestCase {
);
}
- public function testAfterControllerNoShareInfo() {
- $response = $this->createMock(Http\Response::class);
+ public function testAfterControllerNoShareInfo(): void {
+ $response = $this->createMock(Response::class);
$this->assertEquals(
$response,
@@ -94,8 +96,8 @@ class ShareInfoMiddlewareTest extends TestCase {
);
}
- public function testAfterControllerNoJSON() {
- $response = $this->createMock(Http\Response::class);
+ public function testAfterControllerNoJSON(): void {
+ $response = $this->createMock(Response::class);
$this->assertEquals(
$response,
@@ -103,7 +105,7 @@ class ShareInfoMiddlewareTest extends TestCase {
);
}
- public function testAfterControllerJSONok() {
+ public function testAfterControllerJSONok(): void {
$data = ['foo' => 'bar'];
$response = new JSONResponse($data);
@@ -118,7 +120,7 @@ class ShareInfoMiddlewareTest extends TestCase {
);
}
- public function testAfterControllerJSONerror() {
+ public function testAfterControllerJSONerror(): void {
$data = ['foo' => 'bar'];
$response = new JSONResponse($data, Http::STATUS_FORBIDDEN);