[otrs-cvs] otrs/scripts/test/Ticket TicketHistory.t,1.5,1.6

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/scripts/test/Ticket
In directory lancelot:/tmp/cvs-serv23272/scripts/test/Ticket

Modified Files:
	TicketHistory.t 
Log Message:
 - 2013-01-14 Fixed bug#9047 - HistoryTicketGet caches info on disk directly.

Author: mg

Index: TicketHistory.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/Ticket/TicketHistory.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -2 -u -d -r1.5 -r1.6
--- TicketHistory.t	20 Nov 2012 16:13:18 -0000	1.5
+++ TicketHistory.t	14 Jan 2013 12:18:10 -0000	1.6
@@ -1,5 +1,5 @@
 # --
 # TicketHistory.t - ticket module testscript
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -47,4 +47,6 @@
 );
 
+$TicketObject->{CacheInternalObject}->CleanUp();
+
 my @Tests = (
     {
@@ -155,4 +157,5 @@
     if ( $Test->{CreateData} ) {
         for my $CreateData ( @{ $Test->{CreateData} } ) {
+
             if ( $CreateData->{TicketCreate} ) {
                 $HistoryCreateTicketID = $TicketObject->TicketCreate(
@@ -168,4 +171,5 @@
                 }
             }
+
             if ( $CreateData->{ArticleCreate} ) {
                 my $HistoryCreateArticleID = $TicketObject->ArticleCreate(
@@ -181,5 +185,62 @@
                 }
             }
+
+            if ( $CreateData->{TicketCreate} ) {
+                my %ComputedTicketState = $TicketObject->HistoryTicketGet(
+                    StopDay   => 1,
+                    StopMonth => 1,
+                    StopYear  => 1990,
+                    TicketID  => $HistoryCreateTicketID,
+                );
+
+                $Self->False(
+                    %ComputedTicketState ? 1 : 0,
+                    "HistoryTicketGet() - state before ticket was created",
+                );
+
+                my %ComputedTicketStateCached = $TicketObject->HistoryTicketGet(
+                    StopDay   => 1,
+                    StopMonth => 1,
+                    StopYear  => 1990,
+                    TicketID  => $HistoryCreateTicketID,
+                );
+
+                $Self->IsDeeply(
+                    \%ComputedTicketStateCached,
+                    \%ComputedTicketState,
+                    "HistoryTicketGet() - cached ticket data before ticket was created",
+                );
+
+                %ComputedTicketState = $TicketObject->HistoryTicketGet(
+                    StopDay   => 1,
+                    StopMonth => 1,
+                    StopYear  => 2990,
+                    TicketID  => $HistoryCreateTicketID,
+                );
+
+                for my $Key (qw(OwnerID PriorityID Queue State)) {
+
+                    $Self->Is(
+                        $ComputedTicketState{$Key},
+                        $CreateData->{TicketCreate}->{$Key},
+                        "HistoryTicketGet() - uncached value $Key",
+                    );
+                }
+
+                %ComputedTicketStateCached = $TicketObject->HistoryTicketGet(
+                    StopDay   => 1,
+                    StopMonth => 1,
+                    StopYear  => 2990,
+                    TicketID  => $HistoryCreateTicketID,
+                );
+
+                $Self->IsDeeply(
+                    \%ComputedTicketStateCached,
+                    \%ComputedTicketState,
+                    "HistoryTicketGet() - cached ticket data",
+                );
+            }
         }
+
     }
 
@@ -188,4 +249,5 @@
         REFERENCEDATA:
         for my $ReferenceData ( @{ $Test->{ReferenceData} } ) {
+
             $HistoryCreateTicketID = $HistoryCreateTicketIDs[ $ReferenceData->{TicketIndex} ];
 
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.