# Copyright (c) 2005 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: CalendarEvent.bunit,v 1.4 2008/03/27 19:26:13 nagler Exp $ Request(); req()->set_realm_and_user(ShellUtil_SQL()->DEMO); my($now) = DateTime()->now; my($now_100) = DateTime()->add_seconds($now, 100); my($v) = { dtstart => $now, dtend => $now_100, location => 'loc', summary => 'sum', description => 'desc', url => 'http://www.example.com', }; [ [req()] => [ create_from_vevent => [ #TODO: removed this - it causes everything to fail on Redhat 7.2 # [{}] => DB_ERROR(), [{ %$v, url => 'bad url', }] => DIE(), [$v] => undef, ], update => [ [{modified_date_time => $now_100}] => undef, ], update_from_vevent => [ [$v] => undef, ], get => [ modified_date_time => $now_100, ], update_from_vevent => [ [{ %$v, summary => 'other summary', }] => undef, ], get => [ modified_date_time => sub { my(undef, $actual) = @_; return $actual->[0] ne $now_100 ? 1 : 0; }, ], update => [ [{modified_date_time => $now_100}] => undef, ], update_from_vevent => [ [{ %$v, description => undef, location => undef, url => undef, }] => undef, ], ], ];