diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-07-26 15:21:41 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-07-27 20:12:16 +0200 |
commit | b6dd2ebd3909017b9a5dbe0e145d6c5041a9043c (patch) | |
tree | 63a2bdf57168cca766dfadb2d5d1608e2b6ffdf7 /tests/Core/Controller | |
parent | 1ec98af3e028f5aa8591bda26d5dac96dfd66f43 (diff) | |
download | nextcloud-server-b6dd2ebd3909017b9a5dbe0e145d6c5041a9043c.tar.gz nextcloud-server-b6dd2ebd3909017b9a5dbe0e145d6c5041a9043c.zip |
Use proper exception in lostController
There is no need to log the expcetion of most of the stuff here.
We should properly log them but an exception is excessive.
This moves it to a proper exception which we can catch and then log.
The other exceptions will still be fully logged.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/Core/Controller')
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index 8500819a9ca..41f3bb03f02 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -275,8 +275,10 @@ class LostControllerTest extends \Test\TestCase { array(false, $nonExistingUser) ))); - $this->logger->expects($this->exactly(2)) + $this->logger->expects($this->exactly(0)) ->method('logException'); + $this->logger->expects($this->exactly(2)) + ->method('warning'); $this->userManager ->method('getByEmail') @@ -722,8 +724,10 @@ class LostControllerTest extends \Test\TestCase { ->with('ExistingUser') ->willReturn($user); - $this->logger->expects($this->exactly(1)) + $this->logger->expects($this->exactly(0)) ->method('logException'); + $this->logger->expects($this->once()) + ->method('warning'); $response = $this->lostController->email('ExistingUser'); $expectedResponse = new JSONResponse(['status' => 'success']); @@ -807,8 +811,10 @@ class LostControllerTest extends \Test\TestCase { ->method('getByEmail') ->willReturn([$user1, $user2]); - $this->logger->expects($this->exactly(1)) + $this->logger->expects($this->exactly(0)) ->method('logException'); + $this->logger->expects($this->once()) + ->method('warning'); // request password reset for test@example.com $response = $this->lostController->email('test@example.com'); |