]> 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)
committerThomas Citharel <tcit@tcit.fr>
Thu, 26 Mar 2020 17:45:40 +0000 (18:45 +0100)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
apps/dav/tests/unit/CalDAV/CalDavBackendTest.php

index 31c51521885be1a1b832ba3f2e098fc5fd17e8a0..212b09f31fb498a87e042f40baf71f0405d71a2c 100644 (file)
@@ -806,7 +806,7 @@ EOD;
        /**
         * @dataProvider searchDataProvider
         */
-       public function testSearch($isShared, $count) {
+       public function testSearch(bool $isShared, array $searchOptions, int $count) {
                $calendarId = $this->createTestCalendar();
 
                $uris = [];
@@ -899,8 +899,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);
 
@@ -909,8 +907,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],
                ];
        }