#!perl use Cassandane::Tiny; sub test_allday_notz :min_version_3_0 { my ($self) = @_; my $CalDAV = $self->{caldav}; my $CalendarId = $CalDAV->NewCalendar({name => 'foo'}); $self->assert_not_null($CalendarId); my $now = DateTime->now(); $now->set_time_zone('Australia/Sydney'); # bump everything forward so a slow run (say: valgrind) # doesn't cause things to magically fire... $now->add(DateTime::Duration->new(seconds => 300)); # define the event to start today my $startdt = $now->clone(); $startdt->add(DateTime::Duration->new(days => 1)); $startdt->truncate(to => 'day'); my $start = $startdt->strftime('%Y%m%d'); my $enddt = $startdt->clone(); $enddt->add(DateTime::Duration->new(days => 1)); my $end = $enddt->strftime('%Y%m%d'); my $utc = DateTime::Format::ISO8601->new->parse_datetime($start . 'T000000Z'); # set the trigger to notify us at the start of the event my $trigger="PT0S"; my $uuid = "95989f3d-575f-4828-9610-6f16b9d54d04"; my $href = "$CalendarId/$uuid.ics"; my $card = <Request('PUT', $href, $card, 'Content-Type' => 'text/calendar'); # clean notification cache $self->{instance}->getnotify(); $self->{instance}->run_command({ cyrus => 1 }, 'calalarmd', '-t' => $now->epoch() + 60 ); $self->assert_alarms(); $self->{instance}->run_command({ cyrus => 1 }, 'calalarmd', '-t' => $utc->epoch() - 60 ); $self->assert_alarms(); $self->{instance}->run_command({ cyrus => 1 }, 'calalarmd', '-t' => $utc->epoch() + 60 ); $self->assert_alarms({summary => 'allday', start => $start, timezone => '[floating]'}); }