summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2020-03-24 15:12:21 +0100
committerGitHub <noreply@github.com>2020-03-24 15:12:21 +0100
commit3e338c907533dd77599b576ecfadd44b3d1a9855 (patch)
tree737853675c02dbab58be6aba6c06c578c0c76da4 /apps/dav/tests/unit/CalDAV
parentb31c98a5498fb2ee4db00ea09506cc96c5937a19 (diff)
parent709e7447edf4414dd0762bdb640977fd4dba815b (diff)
downloadnextcloud-server-3e338c907533dd77599b576ecfadd44b3d1a9855.tar.gz
nextcloud-server-3e338c907533dd77599b576ecfadd44b3d1a9855.zip
Merge pull request #18788 from nextcloud/fix/18782/translate-busy-in-caldav
Translate 'Busy' in CalDAV
Diffstat (limited to 'apps/dav/tests/unit/CalDAV')
-rw-r--r--apps/dav/tests/unit/CalDAV/CalendarTest.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php
index a2481e59ae9..80e75beca5f 100644
--- a/apps/dav/tests/unit/CalDAV/CalendarTest.php
+++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php
@@ -1,12 +1,14 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2020, Gary Kim <gary@garykim.dev>
*
* @author Georg Ehrke <oc.list@georgehrke.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Gary Kim <gary@garykim.dev>
*
* @license AGPL-3.0
*
@@ -73,7 +75,7 @@ class CalendarTest extends TestCase {
$c->delete();
}
-
+
public function testDeleteFromGroup() {
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
@@ -427,6 +429,27 @@ EOD;
} else {
$this->assertEquals('Test Event', $event->VEVENT->SUMMARY->getValue());
}
+
+ // Test l10n
+ $l10n = $this->createMock(IL10N::class);
+ if ($isShared) {
+ $l10n->expects($this->once())
+ ->method('t')
+ ->with('Busy')
+ ->willReturn("Translated busy");
+ } else {
+ $l10n->expects($this->never());
+ }
+ $c = new Calendar($backend, $calendarInfo, $l10n, $this->config);
+
+ $calData = $c->getChild('event-1')->get();
+ $event = Reader::read($calData);
+
+ if ($isShared) {
+ $this->assertEquals('Translated busy', $event->VEVENT->SUMMARY->getValue());
+ } else {
+ $this->assertEquals('Test Event', $event->VEVENT->SUMMARY->getValue());
+ }
}
public function providesConfidentialClassificationData() {