[otrs-cvs] otrs/scripts/test LinkObject.t,1.20,1.20.4.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
In directory lancelot:/tmp/cvs-serv12656/scripts/test

Modified Files:
      Tag: rel-3_1
	LinkObject.t 
Log Message:
Fixed bug #9054 - Link Object deletes all links under certain conditions.

Author: ub

Index: LinkObject.t
===================================================================
RCS file: /home/cvs/otrs/scripts/test/LinkObject.t,v
retrieving revision 1.20
retrieving revision 1.20.4.1
diff -2 -u -d -r1.20 -r1.20.4.1
--- LinkObject.t	29 Oct 2010 07:58:22 -0000	1.20
+++ LinkObject.t	21 Jan 2013 15:06:02 -0000	1.20.4.1
@@ -1,5 +1,5 @@
 # --
 # LinkObject.t - link object module testscript
-# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
+# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 # --
 # $Id$
@@ -1808,4 +1808,24 @@
             Type    => $TypeNames[99],
         },
+        10013 => {
+            Object1 => $ObjectNames[41],
+            Object2 => $ObjectNames[42],
+            Type    => $TypeNames[6],
+        },
+        10014 => {
+            Object1 => $ObjectNames[42],
+            Object2 => $ObjectNames[41],
+            Type    => $TypeNames[6],
+        },
+        10015 => {
+            Object1 => $ObjectNames[41],
+            Object2 => $ObjectNames[42],
+            Type    => $TypeNames[7],
+        },
+        10016 => {
+            Object1 => $ObjectNames[42],
+            Object2 => $ObjectNames[41],
+            Type    => $TypeNames[7],
+        },
     };
 
@@ -2638,4 +2658,88 @@
         },
     },
+
+    # add 2 links between the same objects but 2 different link types
+    {
+        SourceData => [
+            {
+                Action       => 'LinkAdd',
+                SourceObject => $ObjectNames[41],
+                SourceKey    => '4100',
+                TargetObject => $ObjectNames[42],
+                TargetKey    => '4200',
+                Type         => $TypeNames[6],
+                State        => 'Valid',
+                UserID       => 1,
+            },
+            {
+                Action       => 'LinkAdd',
+                SourceObject => $ObjectNames[41],
+                SourceKey    => '4100',
+                TargetObject => $ObjectNames[42],
+                TargetKey    => '4200',
+                Type         => $TypeNames[7],
+                State        => 'Valid',
+                UserID       => 1,
+            },
+        ],
+        ReferenceData => {
+            LinkList => {
+                Object => $ObjectNames[41],
+                Key    => '4100',
+                Type   => '',
+                State  => 'Valid',
+                UserID => 1,
+            },
+            LinkListReference => {
+                $ObjectNames[42] => {
+                    $TypeNames[6] => {
+                        Target => {
+                            4100 => 1,
+                        },
+                    },
+                    $TypeNames[7] => {
+                        Target => {
+                            4100 => 1,
+                        },
+                    },
+                },
+            },
+        },
+    },
+
+    # delete one of the links from the test before and check that the other link still exists
+    {
+        SourceData => [
+            {
+                Action  => 'LinkDelete',
+                Object1 => $ObjectNames[41],
+                Key1    => '4100',
+                Object2 => $ObjectNames[42],
+                Key2    => '4200',
+                Type    => $TypeNames[6],
+                State   => 'Valid',
+                UserID  => 1,
+            },
+        ],
+        ReferenceData => {
+            LinkList => {
+                Object => $ObjectNames[41],
+                Key    => '4100',
+                Type   => $TypeNames[7],
+                State  => 'Valid',
+                UserID => 1,
+            },
+            LinkListReference => {
+                $ObjectNames[42] => {
+                    $TypeNames[7] => {
+                        Target => {
+                            4100 => 1,
+                        },
+                    },
+                },
+            },
+        },
+    },
+
 ];
 
@@ -2818,11 +2922,11 @@
 
 # ------------------------------------------------------------ #
-# run link tests
+# clean up link tests
 # ------------------------------------------------------------ #
 
-# create needed random object names
+# remove random object names
 for my $Name (@ObjectNames) {
 
-    # create the backend file
+    # delete the backend file
     $Self->{MainObject}->FileDelete(
         Directory       => $BackendLocation,
---------------------------------------------------------------------
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.