summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2020-01-10 01:07:24 +0800
committerGary Kim <gary@garykim.dev>2020-02-23 22:38:24 +0800
commit709e7447edf4414dd0762bdb640977fd4dba815b (patch)
tree8a87e1bd1cd4fd199644516ed8d96f377621e14b /apps/dav/tests
parentd06014353d2ebf53d1aceac22c44ad5c6a5e3165 (diff)
downloadnextcloud-server-709e7447edf4414dd0762bdb640977fd4dba815b.tar.gz
nextcloud-server-709e7447edf4414dd0762bdb640977fd4dba815b.zip
Translate 'Busy' in CalDAV
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'apps/dav/tests')
-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() {