aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/tests
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2020-09-24 22:32:27 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2020-09-24 22:32:27 +0200
commita61394d52833ade6fef4b2e6935bd5862e089d89 (patch)
tree0a920b0212681b180640932dc28a181a6da0dd37 /apps/user_status/tests
parent4123164155d0be35ff91a8fa3c8cfac821e72705 (diff)
downloadnextcloud-server-a61394d52833ade6fef4b2e6935bd5862e089d89.tar.gz
nextcloud-server-a61394d52833ade6fef4b2e6935bd5862e089d89.zip
Add test case for getDefaultStatusById
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/user_status/tests')
-rw-r--r--apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
index 2f58b5b1df8..f0634c7fbe8 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'));
+ }
}