aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/CalDAV/CalendarTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/CalDAV/CalendarTest.php')
-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() {