From 685f27221289a2b33918048b62427a44573511bb Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 10 Aug 2017 16:25:58 +0200 Subject: Add unit tests Signed-off-by: Roeland Jago Douma --- apps/files_sharing/lib/Middleware/ShareInfoMiddleware.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/files_sharing/lib/Middleware') diff --git a/apps/files_sharing/lib/Middleware/ShareInfoMiddleware.php b/apps/files_sharing/lib/Middleware/ShareInfoMiddleware.php index a069ecacc2a..56e9b48f570 100644 --- a/apps/files_sharing/lib/Middleware/ShareInfoMiddleware.php +++ b/apps/files_sharing/lib/Middleware/ShareInfoMiddleware.php @@ -25,7 +25,7 @@ class ShareInfoMiddleware extends Middleware { * @param string $methodName * @throws S2SException */ - public function beforeController(Controller $controller, $methodName) { + public function beforeController($controller, $methodName) { if (!($controller instanceof ShareInfoController)) { return; } @@ -42,7 +42,7 @@ class ShareInfoMiddleware extends Middleware { * @throws \Exception * @return Response */ - public function afterException(Controller $controller, $methodName, \Exception $exception) { + public function afterException($controller, $methodName, \Exception $exception) { if (!($controller instanceof ShareInfoController)) { throw $exception; } @@ -50,6 +50,8 @@ class ShareInfoMiddleware extends Middleware { if ($exception instanceof S2SException) { return new JSONResponse([], Http::STATUS_NOT_FOUND); } + + throw $exception; } /** @@ -58,7 +60,7 @@ class ShareInfoMiddleware extends Middleware { * @param Response $response * @return Response */ - public function afterController(Controller $controller, $methodName, Response $response) { + public function afterController($controller, $methodName, Response $response) { if (!($controller instanceof ShareInfoController)) { return $response; } -- cgit v1.2.3