diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-23 18:23:52 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-02-07 11:23:32 +0100 |
commit | d315bce30041b8521db1433ea115a021b261ebf6 (patch) | |
tree | d9ea982e89f2057c9864d54a1c515d0d1792a3ff /apps/dav/tests | |
parent | 110fc79918c5c843dbd51373cb4f78f5f19697c3 (diff) | |
download | nextcloud-server-d315bce30041b8521db1433ea115a021b261ebf6.tar.gz nextcloud-server-d315bce30041b8521db1433ea115a021b261ebf6.zip |
Improve behavior with dates on 32bits and fix tests or skip them
We do not support events after 2038 on 32bits but still behave better
when date range start/end is after 2038.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalDavBackendTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index cfdf82e9b4f..b39f5909919 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -125,7 +125,6 @@ class CalDavBackendTest extends AbstractCalDavBackend { * @dataProvider providesSharingData */ public function testCalendarSharing($userCanRead, $userCanWrite, $groupCanRead, $groupCanWrite, $add): void { - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject $l10n */ $l10n = $this->createMock(IL10N::class); $l10n @@ -423,7 +422,12 @@ EOD; $events[0] = $this->createEvent($calendarId, '20130912T130000Z', '20130912T140000Z'); $events[1] = $this->createEvent($calendarId, '20130912T150000Z', '20130912T170000Z'); $events[2] = $this->createEvent($calendarId, '20130912T173000Z', '20130912T220000Z'); - $events[3] = $this->createEvent($calendarId, '21130912T130000Z', '22130912T130000Z'); + if (PHP_INT_SIZE > 8) { + $events[3] = $this->createEvent($calendarId, '21130912T130000Z', '22130912T130000Z'); + } else { + /* On 32bit we do not support events after 2038 */ + $events[3] = $this->createEvent($calendarId, '20370912T130000Z', '20370912T130000Z'); + } $result = $this->backend->calendarQuery($calendarId, [ 'name' => '', @@ -471,7 +475,7 @@ EOD; 'only-events' => [[0, 1, 2, 3], [], [['name' => 'VEVENT', 'is-not-defined' => false, 'comp-filters' => [], 'time-range' => ['start' => null, 'end' => null], 'prop-filters' => []]],], 'start' => [[1, 2, 3], [], [['name' => 'VEVENT', 'is-not-defined' => false, 'comp-filters' => [], 'time-range' => ['start' => new DateTime('2013-09-12 14:00:00', new DateTimeZone('UTC')), 'end' => null], 'prop-filters' => []]],], 'end' => [[0], [], [['name' => 'VEVENT', 'is-not-defined' => false, 'comp-filters' => [], 'time-range' => ['start' => null, 'end' => new DateTime('2013-09-12 14:00:00', new DateTimeZone('UTC'))], 'prop-filters' => []]],], - 'future' => [[3], [], [['name' => 'VEVENT', 'is-not-defined' => false, 'comp-filters' => [], 'time-range' => ['start' => new DateTime('2099-09-12 14:00:00', new DateTimeZone('UTC')), 'end' => null], 'prop-filters' => []]],], + 'future' => [[3], [], [['name' => 'VEVENT', 'is-not-defined' => false, 'comp-filters' => [], 'time-range' => ['start' => new DateTime('2036-09-12 14:00:00', new DateTimeZone('UTC')), 'end' => null], 'prop-filters' => []]],], ]; } |