[otrs-cvs] otrs/scripts/test/ProcessManagement/TransitionAction StateSet.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/ProcessManagement/TransitionAction
In directory lancelot:/tmp/cvs-serv11034/scripts/test/ProcessManagement/TransitionAction
Modified Files:
StateSet.t
Log Message:
Removed DynamicField support for StateSet.
Author: cr
Index: StateSet.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/ProcessManagement/TransitionAction/StateSet.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -2 -u -d -r1.5 -r1.6
--- StateSet.t 20 Nov 2012 16:12:03 -0000 1.5
+++ StateSet.t 4 Jan 2013 17:03:55 -0000 1.6
@@ -1,5 +1,5 @@
# --
# StateSet.t - StateSet testscript
-# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id$
@@ -18,5 +18,4 @@
use Kernel::System::UnitTest::Helper;
use Kernel::System::Ticket;
-use Kernel::System::DynamicField;
use Kernel::System::ProcessManagement::TransitionAction::StateSet;
@@ -34,12 +33,4 @@
ConfigObject => $ConfigObject,
);
-my $DynamicFieldObject = Kernel::System::DynamicField->new(
- %{$Self},
- ConfigObject => $ConfigObject,
-);
-my $BackendObject = Kernel::System::DynamicField::Backend->new(
- %{$Self},
- ConfigObject => $ConfigObject,
-);
my $ModuleObject = Kernel::System::ProcessManagement::TransitionAction::StateSet->new(
@@ -54,47 +45,4 @@
my $RandomID = $HelperObject->GetRandomID();
-my $NumericRandomID = int rand 1000_000;
-my $DFName1 = 'Test1' . $NumericRandomID;
-my $DFValue1 = 'Test1';
-
-# ----------------------------------------
-# Create the dynamic fields for testing
-# ----------------------------------------
-
-my @NewDynamicFieldConfig = (
- {
- Name => $DFName1,
- Label => $DFName1,
- FieldType => 'Text',
- ObjectType => 'Ticket',
- Config => {
- DefaultValue => '',
- },
- },
-);
-
-my @AddedDynamicFields;
-for my $DynamicFieldConfig (@NewDynamicFieldConfig) {
-
- # add the new dynamic field
- my $ID = $DynamicFieldObject->DynamicFieldAdd(
- %{$DynamicFieldConfig},
- FieldOrder => 99999,
- ValidID => 1,
- UserID => 1,
- );
-
- push @AddedDynamicFields, $ID;
-
- # sanity check
- $Self->True(
- $ID,
- "DynamicFieldAdd() - DynamicField: $ID for DynamicFieldSet"
- . " checks with True",
- );
-}
-
-# ----------------------------------------
-
# ----------------------------------------
# Create a test ticket
@@ -133,31 +81,4 @@
);
-# set dynamic field
-my $Success = $BackendObject->ValueSet(
- DynamicFieldConfig => {
- %{ $NewDynamicFieldConfig[0] },
- ID => $AddedDynamicFields[0],
- },
-
- ObjectID => $TicketID,
- Value => $DFValue1,
- UserID => $UserID,
-);
-
-$Self->True(
- $Success,
- "DynamicFieldSet() - Set DynamicFIeld_" . $DFName1 . " to $DFValue1",
-);
-
-%Ticket = $TicketObject->TicketGet(
- TicketID => $TicketID,
- DynamicFields => 1,
- UserID => $UserID,
-);
-$Self->True(
- IsHashRefWithData( \%Ticket ),
- "TicketGet() - Get Ticket (Inc. Dynamic Fields) with ID $TicketID.",
-);
-
# ----------------------------------------
@@ -254,110 +175,5 @@
},
{
- Name => 'Missing DynamicFieldMapping',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- },
- },
- Success => 0,
- },
- {
- Name => 'Missing DynamicField',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => undef,
- DynamicFieldMapping => {
- $DFValue1 => {
- State => 'Open',
- },
- },
- },
- },
- Success => 0,
- },
- {
- Name => 'Wrong DynamicFieldMapping format',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => 1,
- },
- },
- Success => 0,
- },
- {
- Name => 'Wrong State in DynamicField',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- State => 'NotExisiting' . $RandomID,
- },
- },
- },
- },
- Success => 0,
- },
- {
- Name => 'Wrong StateID in DynamicField',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- StateID => 'NotExisiting' . $RandomID,
- },
- },
- },
- },
- Success => 0,
- },
- {
- Name => 'Wrong DynamicFieldMapping',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- Other => 'closed successful',
- },
- },
- },
- },
- Success => 0,
- },
- {
- Name => 'Wrong DynamicField (Should Success)',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => 'Notexisting' . $NumericRandomID,
- DynamicFieldMapping => {
- $DFValue1 => {
- State => 'closed successful',
- },
- },
-
- },
- },
- Success => 1,
- NewValue => 0,
- },
- {
- Name => 'Correct State',
+ Name => 'Correct State open',
Config => {
UserID => $UserID,
@@ -367,86 +183,38 @@
},
},
- Success => 1,
- NewValue => 1,
- },
- {
- Name => 'Correct StateID',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- StateID => 5,
- },
- },
- Success => 1,
- NewValue => 1,
- },
- {
- Name => 'Correct State in DynamicFieldMapping',
- Config => {
- UserID => $UserID,
- Ticket => \%Ticket,
- Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- State => 'pending reminder',
- },
- },
- },
- },
- Success => 1,
- NewValue => 1,
+ Success => 1,
},
{
- Name => 'Correct StateID in DynamicFieldMapping',
+ Name => 'Correct State closed successful',
Config => {
UserID => $UserID,
Ticket => \%Ticket,
Config => {
- DynamicField => $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- StateID => 7,
- },
- },
+ State => 'closed successful',
},
},
- Success => 1,
- NewValue => 1,
+ Success => 1,
},
{
- Name => 'Correct State in DynamicFieldMapping Full DF Name',
+ Name => 'Correct StateID open',
Config => {
UserID => $UserID,
Ticket => \%Ticket,
Config => {
- DynamicField => 'DynamicField_' . $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- State => 'pending reminder',
- },
- },
+ StateID => 4,
},
},
- Success => 1,
- NewValue => 1,
+ Success => 1,
},
{
- Name => 'Correct StateID in DynamicFieldMapping Full DF Name',
+ Name => 'Correct StateID closed successful',
Config => {
UserID => $UserID,
Ticket => \%Ticket,
Config => {
- DynamicField => 'DynamicField_' . $DFName1,
- DynamicFieldMapping => {
- $DFValue1 => {
- StateID => 7,
- },
- },
+ StateID => 2,
},
},
- Success => 1,
- NewValue => 1,
+ Success => 1,
},
);
@@ -464,60 +232,23 @@
# get ticket
%Ticket = $TicketObject->TicketGet(
- TicketID => $TicketID,
- DynamicFields => 1,
- UserID => 1,
+ TicketID => $TicketID,
+ UserID => 1,
);
- if ( $Test->{Config}->{Config}->{State} || $Test->{Config}->{Config}->{StateID} ) {
-
- ATTRIBUTE:
- for my $Attribute ( sort keys %{ $Test->{Config}->{Config} } ) {
-
- $Self->True(
- $Ticket{$Attribute},
- "$ModuleName - Test:'$Test->{Name}' | Attribute: $Attribute for TicketID:"
- . " $TicketID exists with True",
- );
-
- $Self->Is(
- $Ticket{$Attribute},
- $Test->{Config}->{Config}->{$Attribute},
- "$ModuleName - Test:'$Test->{Name}' | Attribute: $Attribute for TicketID:"
- . " $TicketID match expected value",
- );
- }
- }
- else {
-
- ATTRIBUTE:
- for my $Attribute (
- sort keys %{ $Test->{Config}->{Config}->{DynamicFieldMapping}->{$DFValue1} }
- )
- {
+ ATTRIBUTE:
+ for my $Attribute ( sort keys %{ $Test->{Config}->{Config} } ) {
- $Self->True(
- $Ticket{$Attribute},
- "$ModuleName - Test:'$Test->{Name}' | Attribute: $DFValue1 -> $Attribute for"
- . " TicketID: $TicketID exists with True",
- );
+ $Self->True(
+ $Ticket{$Attribute},
+ "$ModuleName - Test:'$Test->{Name}' | Attribute: $Attribute for TicketID:"
+ . " $TicketID exists with True",
+ );
- if ( $Test->{NewValue} ) {
- $Self->Is(
- $Ticket{$Attribute},
- $Test->{Config}->{Config}->{DynamicFieldMapping}->{$DFValue1}->{$Attribute},
- "$ModuleName - Test:'$Test->{Name}' | Attribute: $DFValue1 -> $Attribute"
- . " for TicketID: $TicketID match expected value",
- );
- }
- else {
- $Self->IsNot(
- $Test->{Config}->{Config}->{DynamicFieldMapping}->{$DFValue1}->{$Attribute},
- $Ticket{$Attribute},
- "$ModuleName - Test:'$Test->{Name}' | Attribute: $DFValue1 -> $Attribute"
- . " for TicketID: $TicketID differs from expected value: "
- . "'$Ticket{$Attribute}'",
- );
- }
- }
+ $Self->Is(
+ $Ticket{$Attribute},
+ $Test->{Config}->{Config}->{$Attribute},
+ "$ModuleName - Test:'$Test->{Name}' | Attribute: $Attribute for TicketID:"
+ . " $TicketID match expected value",
+ );
}
}
@@ -544,18 +275,4 @@
);
-# DynamicFields
-for my $ID (@AddedDynamicFields) {
- my $Success = $DynamicFieldObject->DynamicFieldDelete(
- ID => $ID,
- UserID => 1,
- Reorder => 1,
- );
-
- $Self->True(
- $Success,
- "DynamicFieldDelete() - Remove DynamicField $ID from the system with True"
- );
-}
-
# ----------------------------------------
---------------------------------------------------------------------
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