From a61394d52833ade6fef4b2e6935bd5862e089d89 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Thu, 24 Sep 2020 22:32:27 +0200 Subject: [PATCH] Add test case for getDefaultStatusById Signed-off-by: Daniel Kesselberg --- .../Service/PredefinedStatusServiceTest.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php index 2f58b5b1df..f0634c7fbe 100644 --- a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php +++ b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php @@ -181,4 +181,28 @@ class PredefinedStatusServiceTest extends TestCase { ['unknown-id', false], ]; } + + public function testGetDefaultStatusById(): void { + $this->l10n->expects($this->exactly(5)) + ->method('t') + ->withConsecutive( + ['In a meeting'], + ['Commuting'], + ['Working remotely'], + ['Out sick'], + ['Vacationing'] + ) + ->willReturnArgument(0); + + $this->assertEquals([ + 'id' => 'vacationing', + 'icon' => '🌴', + 'message' => 'Vacationing', + 'clearAt' => null, + ], $this->service->getDefaultStatusById('vacationing')); + } + + public function testGetDefaultStatusByUnknownId(): void { + $this->assertNull($this->service->getDefaultStatusById('unknown')); + } }