diff options
author | Anna Larch <anna@nextcloud.com> | 2022-08-25 12:28:27 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2022-08-25 12:28:27 +0300 |
commit | 81c7e771f739ccac351e06fa19d5f4aee7b1afbe (patch) | |
tree | 5c678cea454c808ba7c970cbcb8ec283edf00424 /tests | |
parent | ca3f9296ba110725863f4a83e984a9bd77ac1776 (diff) |
Remove unneccessary account checkperf/remove-account-check
As we're already joining on the user accounts table, the account doesn't need to be queried again for a single show.
This is a mini performance optimistation.
THe complete account data could also be returned with the JOIN queries as a second
performance improvement, instead of querying the entity fromt he DB again
The update method does just that at the moment.
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Unit/Controller/OutboxControllerTest.php | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/Unit/Controller/OutboxControllerTest.php b/tests/Unit/Controller/OutboxControllerTest.php index 688c3bc21..313511936 100644 --- a/tests/Unit/Controller/OutboxControllerTest.php +++ b/tests/Unit/Controller/OutboxControllerTest.php @@ -98,8 +98,6 @@ class OutboxControllerTest extends TestCase { ->method('getMessage') ->with($message->getId(), $this->userId) ->willReturn($message); - $this->accountService->expects(self::once()) - ->method('find'); $expected = JsonResponse::success($message); $actual = $this->controller->show($message->getId()); @@ -115,30 +113,11 @@ class OutboxControllerTest extends TestCase { ->method('getMessage') ->with($message->getId(), $this->userId) ->willThrowException(new DoesNotExistException('')); - $this->accountService->expects(self::never()) - ->method('find'); $this->expectException(DoesNotExistException::class); $this->controller->show($message->getId()); } - public function testShowAccountNotFound(): void { - $message = new LocalMessage(); - $message->setId(1); - $message->setAccountId(1); - - $this->service->expects(self::once()) - ->method('getMessage') - ->with($message->getId(), $this->userId) - ->willReturn($message); - $this->accountService->expects(self::once()) - ->method('find') - ->willThrowException(new ClientException('', 400)); - - $this->expectException(ClientException::class); - $this->controller->show($message->getId()); - } - public function testSend(): void { $message = new LocalMessage(); $message->setId(1); |