Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-21 16:18:36 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-21 16:18:36 +0300
commitf14311e288c1587a016bfa7b8f20e871874d20cc (patch)
tree82fa66209c1d856616b65bc4344494c9d6e80fa2 /tests
parentc65803fa4595dca40f0dfbf6aebe6c48cd012e51 (diff)
Return full exception trace
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Http/Middleware/ErrorMiddlewareTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php b/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php
index 84f285676..4c7421b19 100644
--- a/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php
+++ b/tests/Unit/Http/Middleware/ErrorMiddlewareTest.php
@@ -25,6 +25,7 @@
namespace OCA\Mail\Tests\Unit\Http\Middleware;
use ChristophWurst\Nextcloud\Testing\TestCase;
+use Exception;
use OCA\Mail\Exception\NotImplemented;
use OCA\Mail\Exception\ServiceException;
use OCA\Mail\Http\Middleware\ErrorMiddleware;
@@ -108,4 +109,20 @@ class ErrorMiddlewareTest extends TestCase {
$this->assertEquals($expectedStatus, $response->getStatus());
}
+ public function testSerializesRecursively() {
+ $inner = new Exception();
+ $outer = new ServiceException("Test", 0, $inner);
+ $controller = $this->createMock(Controller::class);
+ $this->reflector->expects($this->once())
+ ->method('hasAnnotation')
+ ->willReturn(true);
+ $this->logger->expects($this->once())
+ ->method('logException')
+ ->with($outer);
+
+ $response = $this->middleware->afterException($controller, 'index', $outer);
+
+ $this->assertInstanceOf(JSONResponse::class, $response);
+ }
+
}