[otrs-cvs] otrs/scripts/test/ProcessManagement ActivityDialogACL.t, 1.8, 1.9
"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
In directory lancelot:/tmp/cvs-serv18777/scripts/test/ProcessManagement
Modified Files:
ActivityDialogACL.t
Log Message:
Changed hard coded queues to dynamic to make it work on SaaS environments.
Author: cr
Index: ActivityDialogACL.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/ProcessManagement/ActivityDialogACL.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -2 -u -d -r1.8 -r1.9
--- ActivityDialogACL.t 20 Nov 2012 16:10:55 -0000 1.8
+++ ActivityDialogACL.t 7 Dec 2012 19:44:15 -0000 1.9
@@ -18,4 +18,5 @@
use Kernel::System::DynamicField::Backend;
use Kernel::System::CustomerUser;
+use Kernel::System::Queue;
use Kernel::System::Service;
use Kernel::System::SLA;
@@ -99,4 +100,8 @@
ConfigObject => $ConfigObject,
);
+my $QueueObject = Kernel::System::Queue->new(
+ %{$Self},
+ ConfigObject => $ConfigObject,
+);
# We'd need a CustomerUser and an User configured as Agent
@@ -110,9 +115,52 @@
);
+my $RandomID = $HelperObject->GetRandomID();
+
+# create some queues in the system
+my %QueueData1 = (
+ Name => 'Queue1' . $RandomID,
+ ValidID => 1,
+ GroupID => 1,
+ SystemAddressID => 1,
+ SalutationID => 1,
+ SignatureID => 1,
+ Comment => 'Some comment',
+ UserID => 1,
+);
+
+my %QueueData2 = (
+ Name => 'Queue2' . $RandomID,
+ ValidID => 1,
+ GroupID => 1,
+ SystemAddressID => 1,
+ SalutationID => 1,
+ SignatureID => 1,
+ Comment => 'Some comment',
+ UserID => 1,
+);
+
+my $QueueID1 = $QueueObject->QueueAdd(%QueueData1);
+
+# sanity check
+$Self->IsNot(
+ $QueueID1,
+ undef,
+ "QueueAdd() - Added queue '$QueueData1{Name}' for ACL check - should not be undef"
+);
+
+my $QueueID2 = $QueueObject->QueueAdd(%QueueData2);
+
+# sanity check
+$Self->IsNot(
+ $QueueID2,
+ undef,
+ "QueueAdd() - Added queue '$QueueData2{Name}' for ACL check - should not be undef"
+);
+
my %UTConfig;
my $TestData = {
Title => 'test',
- QueueID => 2,
+ QueueID => $QueueID1,
Lock => 'unlock',
Priority => '3 normal',
@@ -377,10 +425,10 @@
Properties => {
Ticket => {
- Queue => ['Raw'],
+ Queue => [ $QueueData1{Name} ],
},
},
Possible => {
Ticket => {
- Queue => ['Junk'],
+ Queue => [ $QueueData2{Name} ],
},
ActivityDialog => [ 'AD5', 'AD6' ],
@@ -552,5 +600,5 @@
DescriptionShort => '',
DescriptionLong => '',
- DefaultValue => 'Raw',
+ DefaultValue => $QueueData1{Name},
Display => 2,
},
@@ -950,5 +998,5 @@
my %QueueResult = (
- '3' => 'Junk'
+ $QueueID2 => $QueueData2{Name},
);
@@ -1097,4 +1145,29 @@
}
+# queue
+my $Success = $QueueObject->QueueUpdate(
+ %QueueData1,
+ QueueID => $QueueID1,
+ FollowUpID => 1,
+ ValidID => 2,
+);
+
+$Self->True(
+ $Success,
+ "QueueUpdate() - Invalidate queue '$QueueData1{Name}' for ACL check."
+);
+
+$Success = $QueueObject->QueueUpdate(
+ %QueueData2,
+ QueueID => $QueueID2,
+ FollowUpID => 1,
+ ValidID => 2,
+);
+
+$Self->True(
+ $Success,
+ "QueueUpdate() - Invalidate queue '$QueueData2{Name}' for ACL check."
+);
+
# ticket
for my $Type (qw(Positive Negative)) {
---------------------------------------------------------------------
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