]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add extra test case to exclude by timerange
authorThomas Citharel <tcit@tcit.fr>
Sun, 5 Jan 2020 20:27:41 +0000 (21:27 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Sun, 22 Mar 2020 13:24:13 +0000 (14:24 +0100)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
apps/dav/tests/unit/CalDAV/CalDavBackendTest.php

index 0094a28dc797f010ad7c55ceb545b7266f2a8721..8ac4961f19ff002f1898ff5e15018937305513bd 100644 (file)
@@ -807,7 +807,7 @@ EOD;
        /**
         * @dataProvider searchDataProvider
         */
-       public function testSearch($isShared, $count) {
+       public function testSearch(bool $isShared, array $searchOptions, int $count) {
                $calendarId = $this->createTestCalendar();
 
                $uris = [];
@@ -900,8 +900,6 @@ EOD;
                        '{http://owncloud.org/ns}owner-principal' => $isShared ? 'user2' : 'user1',
                ];
 
-               $searchOptions = ['timerange' => ['start' => new DateTime('2013-09-12 13:00:00'), 'end' => new DateTime('2013-09-12 14:00:00')]];
-
                $result = $this->backend->search($calendarInfo, 'Test',
                        ['SUMMARY', 'LOCATION', 'ATTENDEE'], $searchOptions, null, null);
 
@@ -910,8 +908,9 @@ EOD;
 
        public function searchDataProvider() {
                return [
-                       [false, 4],
-                       [true, 2],
+                       [false, [], 4],
+                       [true, ['timerange' => ['start' => new DateTime('2013-09-12 13:00:00'), 'end' => new DateTime('2013-09-12 14:00:00')]], 2],
+                       [true, ['timerange' => ['start' => new DateTime('2013-09-12 15:00:00'), 'end' => new DateTime('2013-09-12 16:00:00')]], 0],
                ];
        }