[otrs-cvs] Calendar/scripts/test Calendar.t,1.3,1.4

cvs-log at otrs.org cvs-log at otrs.org
Tue Mar 4 11:16:54 GMT 2008


Comments:
Update of /home/cvs/Calendar/scripts/test
In directory lancelot:/tmp/cvs-serv5357/scripts/test

Modified Files:
	Calendar.t 
Log Message:
Improved unit tests.

Author: martin

Index: Calendar.t
===================================================================
RCS file: /home/cvs/Calendar/scripts/test/Calendar.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Calendar.t	15 Jan 2007 22:17:00 -0000	1.3
--- Calendar.t	4 Mar 2008 11:16:49 -0000	1.4
***************
*** 1,5 ****
  # --
  # Calendar.t - Calendar
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
--- 1,5 ----
  # --
  # Calendar.t - Calendar
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
  # --
  # $Id$
***************
*** 7,11 ****
  # This software comes with ABSOLUTELY NO WARRANTY. For details, see
  # the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
  # --
  
--- 7,11 ----
  # This software comes with ABSOLUTELY NO WARRANTY. For details, see
  # the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
  # --
  
***************
*** 18,26 ****
  my $EventID = $Self->{EventObject}->EventAdd(
      Title => 'Some Test',
!     StartTime => '1977-10-27 20:15',
!     EndTime => '1977-10-27 21:00',
!     SequenceEndTime => '2007-10-27 21:00',
      State => 'public',
!     UserIDs => [1],
  );
  
--- 18,29 ----
  my $EventID = $Self->{EventObject}->EventAdd(
      Title => 'Some Test',
!     Location => 'Some Location',
!     StartTime => '1977-10-27 20:15:00',
!     EndTime => '1977-10-27 21:00:00',
!     SequenceEndTime => '2007-10-27 21:00:00',
      State => 'public',
!     ParticipantIDs => [1],
!     OrganizerID => 1,
!     UserID => 1,
  );
  
***************
*** 33,42 ****
      EventID => $EventID,
      Title => 'Some Test 2',
!     StartTime => '1977-10-27 20:15',
!     EndTime => '1977-10-27 21:00',
!     SequenceEndTime => '2008-10-27 21:00',
      SequenceType => '',
      State => 'public',
!     UserIDs => [1],
  );
  
--- 36,48 ----
      EventID => $EventID,
      Title => 'Some Test 2',
!     Location => 'Some Location 2',
!     StartTime => '1977-10-27 20:15:00',
!     EndTime => '1977-10-27 21:00:00',
!     SequenceEndTime => '2008-10-27 21:00:00',
      SequenceType => '',
      State => 'public',
!     ParticipantIDs => [1],
!     OrganizerID => 1,
!     UserID => 1,
  );
  
***************
*** 48,80 ****
  my %Event = $Self->{EventObject}->EventGet(
      EventID => $EventID,
  );
  
! $Self->True(
!     $Event{Title} eq 'Some Test 2',
      'EventGet()',
  );
  
! my @Events = $Self->{EventObject}->Events(
      StartTime => '1977-10-27 20:20:00',
      EndTime => '1977-10-27 20:30:00',
  );
  
! foreach (@Events) {
!     if ($_ == $EventID) {
!         $Self->True(
!             1,
!             'Events()',
!         );
      }
  }
  
! my $EventDelete = $Self->{EventObject}->EventDelete(
      EventID => $EventID,
  );
  
  $Self->True(
!     $EventDelete,
!     'EventDelete()',
  );
  
! 1;
\ No newline at end of file
--- 54,93 ----
  my %Event = $Self->{EventObject}->EventGet(
      EventID => $EventID,
+     UserID => 1,
  );
  
! $Self->Is(
!     $Event{Title} || '',
!     'Some Test 2',
      'EventGet()',
  );
  
! my @EventIDs = $Self->{EventObject}->Events(
      StartTime => '1977-10-27 20:20:00',
      EndTime => '1977-10-27 20:30:00',
+     UserID => 1,
  );
  
! my $Found = 0;
! foreach my $Event (@EventIDs) {
!     if ($Event->{EventID} == $EventID) {
!         $Found = 1;
!         last;
      }
  }
+ $Self->True(
+     $Found,
+     'Events()',
+ );
  
! my $EventCancel = $Self->{EventObject}->EventCancel(
      EventID => $EventID,
+     UserID => 1,
  );
  
  $Self->True(
!     $EventCancel,
!     'EventCancel()',
  );
  
! 1;


More information about the cvs-log mailing list