summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-10 17:58:01 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-10 17:58:01 +0100
commit7f16aaefc8ea52ce258742f02b0bbe70753eecb9 (patch)
treee006ccceb2a5dcfcb7fe39c53010ebdf0ae2b443 /apps/dav/tests/unit
parentad61c552ea100d9118d2683940160484035f2e91 (diff)
parent6133253a2c95a5ca524aecf1fdeb85ab4d479d49 (diff)
downloadnextcloud-server-7f16aaefc8ea52ce258742f02b0bbe70753eecb9.tar.gz
nextcloud-server-7f16aaefc8ea52ce258742f02b0bbe70753eecb9.zip
Merge pull request #23048 from owncloud/no-fatal-error-if-DSTART-is-not-set
No fatal error if dstart is not set
Diffstat (limited to 'apps/dav/tests/unit')
-rw-r--r--apps/dav/tests/unit/caldav/caldavbackendtest.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/apps/dav/tests/unit/caldav/caldavbackendtest.php b/apps/dav/tests/unit/caldav/caldavbackendtest.php
index aece738166a..87a700a473d 100644
--- a/apps/dav/tests/unit/caldav/caldavbackendtest.php
+++ b/apps/dav/tests/unit/caldav/caldavbackendtest.php
@@ -57,11 +57,11 @@ class CalDavBackendTest extends TestCase {
->disableOriginalConstructor()
->setMethods(['getPrincipalByPath', 'getGroupMembership'])
->getMock();
- $this->principal->method('getPrincipalByPath')
+ $this->principal->expects($this->any())->method('getPrincipalByPath')
->willReturn([
'uri' => 'principals/best-friend'
]);
- $this->principal->method('getGroupMembership')
+ $this->principal->expects($this->any())->method('getGroupMembership')
->withAnyParameters()
->willReturn([self::UNIT_TEST_GROUP]);
@@ -446,6 +446,21 @@ EOD;
$this->assertEquals(0, count($sos));
}
+ /**
+ * @dataProvider providesCalDataForGetDenormalizedData
+ */
+ public function testGetDenormalizedData($expectedFirstOccurance, $calData) {
+ $actual = $this->invokePrivate($this->backend, 'getDenormalizedData', [$calData]);
+ $this->assertEquals($expectedFirstOccurance, $actual['firstOccurence']);
+ }
+
+ public function providesCalDataForGetDenormalizedData() {
+ return [
+ [0, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:413F269B-B51B-46B1-AFB6-40055C53A4DC\r\nDTSTAMP:20160309T095056Z\r\nDTSTART;VALUE=DATE:16040222\r\nDTEND;VALUE=DATE:16040223\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:SUMMARY\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"],
+ [null, "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:413F269B-B51B-46B1-AFB6-40055C53A4DC\r\nDTSTAMP:20160309T095056Z\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:SUMMARY\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"]
+ ];
+ }
+
private function assertAcl($principal, $privilege, $acl) {
foreach($acl as $a) {
if ($a['principal'] === $principal && $a['privilege'] === $privilege) {