[otrs-cvs] otrs/scripts/test/Ticket TicketHistory.t,1.2,1.2.2.1
"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-serv23466/scripts/test/Ticket
Modified Files:
Tag: rel-3_1
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.2
retrieving revision 1.2.2.1
diff -2 -u -d -r1.2 -r1.2.2.1
--- TicketHistory.t 8 Nov 2011 15:24:55 -0000 1.2
+++ TicketHistory.t 14 Jan 2013 12:18:43 -0000 1.2.2.1
@@ -1,5 +1,5 @@
# --
# TicketHistory.t - ticket module testscript
-# Copyright (C) 2001-2011 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