"Fossies" - the Fresh Open Source Software Archive

Member "otrs-5.0.40/scripts/test/Ticket/TicketACL/Action.t" (12 Dec 2019, 28846 Bytes) of package /linux/www/otrs-5.0.40.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Action.t": rel-6_0_25_vs_rel-6_0_26.

    1 # --
    2 # Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
    3 # --
    4 # This software comes with ABSOLUTELY NO WARRANTY. For details, see
    5 # the enclosed file COPYING for license information (GPL). If you
    6 # did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
    7 # --
    8 
    9 use strict;
   10 use warnings;
   11 use utf8;
   12 
   13 use vars (qw($Self));
   14 
   15 # get needed objects
   16 my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
   17 my $TicketObject = $Kernel::OM->Get('Kernel::System::Ticket');
   18 
   19 # get helper object
   20 $Kernel::OM->ObjectParamAdd(
   21     'Kernel::System::UnitTest::Helper' => {
   22         RestoreDatabase => 1,
   23     },
   24 );
   25 my $Helper = $Kernel::OM->Get('Kernel::System::UnitTest::Helper');
   26 
   27 # set user options
   28 my $UserLogin = $Helper->TestUserCreate(
   29     Groups => ['admin'],
   30 ) || die "Did not get test user";
   31 
   32 my $UserID = $Kernel::OM->Get('Kernel::System::User')->UserLookup(
   33     UserLogin => $UserLogin,
   34 );
   35 
   36 my $ExecuteTests = sub {
   37     my %Param = @_;
   38     my @Tests = @{ $Param{Tests} };
   39 
   40     for my $Test (@Tests) {
   41 
   42         # clean previous data
   43         $TicketObject->{TicketAclData} = {};
   44 
   45         $ConfigObject->Set(
   46             Key   => 'TicketAcl',
   47             Value => $Test->{ACLs},
   48         );
   49 
   50         my $GotACLs = $ConfigObject->Get('TicketAcl');
   51 
   52         # sanity check
   53         $Self->IsDeeply(
   54             $GotACLs,
   55             $Test->{ACLs},
   56             "$Test->{Name} ACLs Set and Get from sysconfig",
   57         );
   58 
   59         my $Config     = $Test->{Config};
   60         my $ACLSuccess = $TicketObject->TicketAcl( %{ $Test->{Config} } );
   61 
   62         # get the data from ACL
   63         my %ACLData = $TicketObject->TicketAclActionData();
   64 
   65         if ( !$Test->{SuccessMatch} ) {
   66             $Self->False(
   67                 $ACLSuccess,
   68                 "$Test->{Name} Executed with False",
   69             );
   70 
   71             $Self->IsDeeply(
   72                 \%ACLData,
   73                 {},
   74                 "$Test->{Name} ACL data must be empty",
   75             );
   76         }
   77         else {
   78             $Self->True(
   79                 $ACLSuccess,
   80                 "$Test->{Name} Executed with True",
   81             );
   82 
   83             $Self->IsDeeply(
   84                 \%ACLData,
   85                 $Test->{ReturnActionData},
   86                 "$Test->{Name} ACL data",
   87             );
   88         }
   89 
   90         # clean ACLs
   91         $ConfigObject->Set(
   92             Key   => 'TicketAcl',
   93             Value => {},
   94         );
   95 
   96         $GotACLs = $ConfigObject->Get('TicketAcl');
   97 
   98         # sanity check
   99         $Self->IsDeeply(
  100             $GotACLs,
  101             {},
  102             "$Test->{Name} ACLs are clean",
  103         );
  104     }
  105 };
  106 
  107 # Action tests
  108 my @Tests = (
  109     {
  110         Name => 'ACL Action - Data as a Correct Hash:',
  111         ACLs => {
  112             'Action1' => {
  113                 Properties => {
  114                     Queue => {
  115                         Name => ['Raw'],
  116                     },
  117                 },
  118                 Possible => {
  119                     Action => [ 'AgentTicketClose', ],
  120                 },
  121             },
  122         },
  123         Config => {
  124             Data => {
  125                 1 => 'AgentTicketClose',
  126                 2 => 'AgentTicketBounce',
  127             },
  128             ReturnType    => 'Action',
  129             ReturnSubType => '-',
  130             Queue         => 'Raw',
  131             UserID        => $UserID,
  132         },
  133         SuccessMatch     => 1,
  134         ReturnActionData => {
  135             1 => 'AgentTicketClose',
  136         },
  137     },
  138     {
  139         Name => 'ACL Action - Data as a Correct Scalar:',
  140         ACLs => {
  141             'Action1' => {
  142                 Properties => {
  143                     Queue => {
  144                         Name => ['Raw'],
  145                     },
  146                 },
  147                 Possible => {
  148                     Action => [ 'AgentTicketClose', ],
  149                 },
  150             },
  151         },
  152         Config => {
  153             Data          => 'AgentTicketClose',
  154             ReturnType    => 'Action',
  155             ReturnSubType => '-',
  156             Queue         => 'Raw',
  157             UserID        => $UserID,
  158         },
  159         SuccessMatch     => 1,
  160         ReturnActionData => {
  161             1 => 'AgentTicketClose',
  162         },
  163     },
  164     {
  165         Name => 'ACL Action - Data as a Correct Scalar 2:',
  166         ACLs => {
  167             'Action1' => {
  168                 Properties => {
  169                     Queue => {
  170                         Name => ['Raw'],
  171                     },
  172                 },
  173                 Possible => {
  174                     Action => [ 'AgentTicketBounce', ],
  175                 },
  176             },
  177         },
  178         Config => {
  179             Data          => 'AgentTicketClose',
  180             ReturnType    => 'Action',
  181             ReturnSubType => '-',
  182             Queue         => 'Raw',
  183             UserID        => $UserID,
  184         },
  185         SuccessMatch     => 1,
  186         ReturnActionData => {},
  187     },
  188     {
  189         Name => 'ACL Action - Data as a Correct Hash using [Not]:',
  190         ACLs => {
  191             'Action1' => {
  192                 Properties => {
  193                     Queue => {
  194                         Name => ['Raw'],
  195                     },
  196                 },
  197                 Possible => {
  198                     Action => [ '[Not]AgentTicketClose', ],
  199                 },
  200             },
  201         },
  202         Config => {
  203             Data => {
  204                 1 => 'AgentTicketClose',
  205                 2 => 'AgentTicketBounce',
  206             },
  207             ReturnType    => 'Action',
  208             ReturnSubType => '-',
  209             Queue         => 'Raw',
  210             UserID        => $UserID,
  211         },
  212         SuccessMatch     => 1,
  213         ReturnActionData => {
  214             2 => 'AgentTicketBounce',
  215         },
  216     },
  217     {
  218         Name => 'ACL Action - Data as a Correct Hash using [RegExp]:',
  219         ACLs => {
  220             'Action1' => {
  221                 Properties => {
  222                     Queue => {
  223                         Name => ['Raw'],
  224                     },
  225                 },
  226                 Possible => {
  227                     Action => [ '[RegExp]Close', ],
  228                 },
  229             },
  230         },
  231         Config => {
  232             Data => {
  233                 1 => 'AgentTicketClose',
  234                 2 => 'AgentTicketBounce',
  235             },
  236             ReturnType    => 'Action',
  237             ReturnSubType => '-',
  238             Queue         => 'Raw',
  239             UserID        => $UserID,
  240         },
  241         SuccessMatch     => 1,
  242         ReturnActionData => {
  243             1 => 'AgentTicketClose',
  244         },
  245     },
  246     {
  247         Name => 'ACL Action - Data as a Correct Hash using [regexp]:',
  248         ACLs => {
  249             'Action1' => {
  250                 Properties => {
  251                     Queue => {
  252                         Name => ['Raw'],
  253                     },
  254                 },
  255                 Possible => {
  256                     Action => [ '[regexp]close', ],
  257                 },
  258             },
  259         },
  260         Config => {
  261             Data => {
  262                 1 => 'AgentTicketClose',
  263                 2 => 'AgentTicketBounce',
  264             },
  265             ReturnType    => 'Action',
  266             ReturnSubType => '-',
  267             Queue         => 'Raw',
  268             UserID        => $UserID,
  269         },
  270         SuccessMatch     => 1,
  271         ReturnActionData => {
  272             1 => 'AgentTicketClose',
  273         },
  274     },
  275     {
  276         Name => 'ACL Action - Data as a Correct Hash using [NotRegExp]:',
  277         ACLs => {
  278             'Action1' => {
  279                 Properties => {
  280                     Queue => {
  281                         Name => ['Raw'],
  282                     },
  283                 },
  284                 Possible => {
  285                     Action => [ '[NotRegExp]Close', ],
  286                 },
  287             },
  288         },
  289         Config => {
  290             Data => {
  291                 1 => 'AgentTicketClose',
  292                 2 => 'AgentTicketBounce',
  293             },
  294             ReturnType    => 'Action',
  295             ReturnSubType => '-',
  296             Queue         => 'Raw',
  297             UserID        => $UserID,
  298         },
  299         SuccessMatch     => 1,
  300         ReturnActionData => {
  301             2 => 'AgentTicketBounce',
  302         },
  303     },
  304     {
  305         Name => 'ACL Action - Data as a Correct Hash using [Notregexp]:',
  306         ACLs => {
  307             'Action1' => {
  308                 Properties => {
  309                     Queue => {
  310                         Name => ['Raw'],
  311                     },
  312                 },
  313                 Possible => {
  314                     Action => [ '[Notregexp]close', ],
  315                 },
  316             },
  317         },
  318         Config => {
  319             Data => {
  320                 1 => 'AgentTicketClose',
  321                 2 => 'AgentTicketBounce',
  322             },
  323             ReturnType    => 'Action',
  324             ReturnSubType => '-',
  325             Queue         => 'Raw',
  326             UserID        => $UserID,
  327         },
  328         SuccessMatch     => 1,
  329         ReturnActionData => {
  330             2 => 'AgentTicketBounce',
  331         },
  332     },
  333 
  334     # PossibleAdd tests
  335     {
  336         Name => 'ACL Action - PossibleAdd Data as a Correct Hash:',
  337         ACLs => {
  338             'Action1' => {
  339                 Properties => {
  340                     Queue => {
  341                         Name => ['Raw'],
  342                     },
  343                 },
  344                 Possible => {
  345                     Action => [ 'AgentTicketClose', ],
  346                 },
  347             },
  348             'Action2' => {
  349                 Properties => {
  350                     Queue => {
  351                         Name => ['Raw'],
  352                     },
  353                 },
  354                 PossibleAdd => {
  355                     Action => [ 'AgentTicketBounce', ],
  356                 },
  357             },
  358         },
  359         Config => {
  360             Data => {
  361                 1 => 'AgentTicketClose',
  362                 2 => 'AgentTicketForward',
  363                 3 => 'AgentTicketBounce',
  364             },
  365             ReturnType    => 'Action',
  366             ReturnSubType => '-',
  367             Queue         => 'Raw',
  368             UserID        => $UserID,
  369         },
  370         SuccessMatch     => 1,
  371         ReturnActionData => {
  372             1 => 'AgentTicketClose',
  373             3 => 'AgentTicketBounce',
  374         },
  375     },
  376     {
  377         Name => 'ACL Action - PossibleAdd Data as a Correct Scalar:',
  378         ACLs => {
  379             'Action1' => {
  380                 Properties => {
  381                     Queue => {
  382                         Name => ['Raw'],
  383                     },
  384                 },
  385                 Possible => {
  386                     Action => [ 'AgentTicketClose', ],
  387                 },
  388             },
  389             'Action2' => {
  390                 Properties => {
  391                     Queue => {
  392                         Name => ['Raw'],
  393                     },
  394                 },
  395                 PossibleAdd => {
  396                     Action => [ 'AgentTicketBounce', ],
  397                 },
  398             },
  399         },
  400         Config => {
  401             Data          => 'AgentTicketBounce',
  402             ReturnType    => 'Action',
  403             ReturnSubType => '-',
  404             Queue         => 'Raw',
  405             UserID        => $UserID,
  406         },
  407         SuccessMatch     => 1,
  408         ReturnActionData => {
  409             1 => 'AgentTicketBounce',
  410         },
  411     },
  412     {
  413         Name => 'ACL Action - PossibleAdd Data as a Correct Scalar 2:',
  414         ACLs => {
  415             'Action1' => {
  416                 Properties => {
  417                     Queue => {
  418                         Name => ['Raw'],
  419                     },
  420                 },
  421                 Possible => {
  422                     Action => [ 'AgentTicketClose', ],
  423                 },
  424             },
  425             'Action2' => {
  426                 Properties => {
  427                     Queue => {
  428                         Name => ['Raw'],
  429                     },
  430                 },
  431                 PossibleAdd => {
  432                     Action => [ 'AgentTicketBounce', ],
  433                 },
  434             },
  435         },
  436         Config => {
  437             Data          => 'AgentTicketForward',
  438             ReturnType    => 'Action',
  439             ReturnSubType => '-',
  440             Queue         => 'Raw',
  441             UserID        => $UserID,
  442         },
  443         SuccessMatch     => 1,
  444         ReturnActionData => {},
  445     },
  446     {
  447         Name => 'ACL Action - PossibleAdd Data as a Correct Hash using [Not]:',
  448         ACLs => {
  449             'Action1' => {
  450                 Properties => {
  451                     Queue => {
  452                         Name => ['Raw'],
  453                     },
  454                 },
  455                 Possible => {
  456                     Action => [ 'AgentTicketForward', ],
  457                 },
  458             },
  459             'Action2' => {
  460                 Properties => {
  461                     Queue => {
  462                         Name => ['Raw'],
  463                     },
  464                 },
  465                 PossibleAdd => {
  466                     Action => [ '[Not]AgentTicketClose', ],
  467                 },
  468             },
  469         },
  470         Config => {
  471             Data => {
  472                 1 => 'AgentTicketClose',
  473                 2 => 'AgentTicketBounce',
  474                 3 => 'AgentTicketForward',
  475             },
  476             ReturnType    => 'Action',
  477             ReturnSubType => '-',
  478             Queue         => 'Raw',
  479             UserID        => $UserID,
  480         },
  481         SuccessMatch     => 1,
  482         ReturnActionData => {
  483             2 => 'AgentTicketBounce',
  484             3 => 'AgentTicketForward'
  485         },
  486     },
  487     {
  488         Name => 'ACL Action - PossibleAdd Data as a Correct Hash using [RegExp]:',
  489         ACLs => {
  490             'Action1' => {
  491                 Properties => {
  492                     Queue => {
  493                         Name => ['Raw'],
  494                     },
  495                 },
  496                 Possible => {
  497                     Action => [ 'AgentTicketForward', ],
  498                 },
  499             },
  500             'Action2' => {
  501                 Properties => {
  502                     Queue => {
  503                         Name => ['Raw'],
  504                     },
  505                 },
  506                 PossibleAdd => {
  507                     Action => [ '[RegExp]Close', ],
  508                 },
  509             },
  510         },
  511         Config => {
  512             Data => {
  513                 1 => 'AgentTicketClose',
  514                 2 => 'AgentTicketBounce',
  515                 3 => 'AgentTicketForward',
  516             },
  517             ReturnType    => 'Action',
  518             ReturnSubType => '-',
  519             Queue         => 'Raw',
  520             UserID        => $UserID,
  521         },
  522         SuccessMatch     => 1,
  523         ReturnActionData => {
  524             1 => 'AgentTicketClose',
  525             3 => 'AgentTicketForward',
  526         },
  527     },
  528     {
  529         Name => 'ACL Action - PossibleAdd Data as a Correct Hash using [regexp]:',
  530         ACLs => {
  531             'Action1' => {
  532                 Properties => {
  533                     Queue => {
  534                         Name => ['Raw'],
  535                     },
  536                 },
  537                 Possible => {
  538                     Action => [ 'AgentTicketForward', ],
  539                 },
  540             },
  541             'Action2' => {
  542                 Properties => {
  543                     Queue => {
  544                         Name => ['Raw'],
  545                     },
  546                 },
  547                 PossibleAdd => {
  548                     Action => [ '[regexp]close', ],
  549                 },
  550             },
  551         },
  552         Config => {
  553             Data => {
  554                 1 => 'AgentTicketClose',
  555                 2 => 'AgentTicketBounce',
  556                 3 => 'AgentTicketForward',
  557             },
  558             ReturnType    => 'Action',
  559             ReturnSubType => '-',
  560             Queue         => 'Raw',
  561             UserID        => $UserID,
  562         },
  563         SuccessMatch     => 1,
  564         ReturnActionData => {
  565             1 => 'AgentTicketClose',
  566             3 => 'AgentTicketForward',
  567         },
  568     },
  569     {
  570         Name => 'ACL Action - PossibleAdd Data as a Correct Hash using [NotRegExp]:',
  571         ACLs => {
  572             'Action1' => {
  573                 Properties => {
  574                     Queue => {
  575                         Name => ['Raw'],
  576                     },
  577                 },
  578                 Possible => {
  579                     Action => [ 'AgentTicketForward', ],
  580                 },
  581             },
  582             'Action2' => {
  583                 Properties => {
  584                     Queue => {
  585                         Name => ['Raw'],
  586                     },
  587                 },
  588                 PossibleAdd => {
  589                     Action => [ '[NotRegExp]Close', ],
  590                 },
  591             },
  592         },
  593         Config => {
  594             Data => {
  595                 1 => 'AgentTicketClose',
  596                 2 => 'AgentTicketBounce',
  597                 3 => 'AgentTicketForward',
  598             },
  599             ReturnType    => 'Action',
  600             ReturnSubType => '-',
  601             Queue         => 'Raw',
  602             UserID        => $UserID,
  603         },
  604         SuccessMatch     => 1,
  605         ReturnActionData => {
  606             2 => 'AgentTicketBounce',
  607             3 => 'AgentTicketForward',
  608         },
  609     },
  610     {
  611         Name => 'ACL Action - PossibleAdd Data as a Correct Hash using [Notregexp]:',
  612         ACLs => {
  613             'Action1' => {
  614                 Properties => {
  615                     Queue => {
  616                         Name => ['Raw'],
  617                     },
  618                 },
  619                 Possible => {
  620                     Action => [ 'AgentTicketForward', ],
  621                 },
  622             },
  623             'Action2' => {
  624                 Properties => {
  625                     Queue => {
  626                         Name => ['Raw'],
  627                     },
  628                 },
  629                 PossibleAdd => {
  630                     Action => [ '[Notregexp]close', ],
  631                 },
  632             },
  633         },
  634         Config => {
  635             Data => {
  636                 1 => 'AgentTicketClose',
  637                 2 => 'AgentTicketBounce',
  638                 3 => 'AgentTicketForward',
  639             },
  640             ReturnType    => 'Action',
  641             ReturnSubType => '-',
  642             Queue         => 'Raw',
  643             UserID        => $UserID,
  644         },
  645         SuccessMatch     => 1,
  646         ReturnActionData => {
  647             2 => 'AgentTicketBounce',
  648             3 => 'AgentTicketForward',
  649         },
  650     },
  651 
  652     # PossibleNot tests
  653     {
  654         Name => 'ACL Action - PossibleNot Data as a Correct Hash:',
  655         ACLs => {
  656             'Action1' => {
  657                 Properties => {
  658                     Queue => {
  659                         Name => ['Raw'],
  660                     },
  661                 },
  662                 PossibleNot => {
  663                     Action => [ 'AgentTicketClose', ],
  664                 },
  665             },
  666         },
  667         Config => {
  668             Data => {
  669                 1 => 'AgentTicketClose',
  670                 2 => 'AgentTicketBounce',
  671             },
  672             ReturnType    => 'Action',
  673             ReturnSubType => '-',
  674             Queue         => 'Raw',
  675             UserID        => $UserID,
  676         },
  677         SuccessMatch     => 1,
  678         ReturnActionData => {
  679             2 => 'AgentTicketBounce',
  680 
  681         },
  682     },
  683     {
  684         Name => 'ACL Action - PossibleNot Data as a Correct Scalar:',
  685         ACLs => {
  686             'Action1' => {
  687                 Properties => {
  688                     Queue => {
  689                         Name => ['Raw'],
  690                     },
  691                 },
  692                 PossibleNot => {
  693                     Action => [ 'AgentTicketClose', ],
  694                 },
  695             },
  696         },
  697         Config => {
  698             Data          => 'AgentTicketClose',
  699             ReturnType    => 'Action',
  700             ReturnSubType => '-',
  701             Queue         => 'Raw',
  702             UserID        => $UserID,
  703         },
  704         SuccessMatch     => 1,
  705         ReturnActionData => {},
  706     },
  707     {
  708         Name => 'ACL Action - PossibleNot Data as a Correct Scalar 2:',
  709         ACLs => {
  710             'Action1' => {
  711                 Properties => {
  712                     Queue => {
  713                         Name => ['Raw'],
  714                     },
  715                 },
  716                 PossibleNot => {
  717                     Action => [ 'AgentTicketBounce', ],
  718                 },
  719             },
  720         },
  721         Config => {
  722             Data          => '-',
  723             Action        => 'AgentTicketClose',
  724             ReturnType    => 'Action',
  725             ReturnSubType => '-',
  726             Queue         => 'Raw',
  727             UserID        => $UserID,
  728         },
  729         SuccessMatch     => 1,
  730         ReturnActionData => {
  731             1 => 'AgentTicketClose',
  732         },
  733     },
  734     {
  735         Name => 'ACL Action - PossibleNot Data as a Correct Hash using [Not]:',
  736         ACLs => {
  737             'Action1' => {
  738                 Properties => {
  739                     Queue => {
  740                         Name => ['Raw'],
  741                     },
  742                 },
  743                 PossibleNot => {
  744                     Action => [ '[Not]AgentTicketClose', ],
  745                 },
  746             },
  747         },
  748         Config => {
  749             Data => {
  750                 1 => 'AgentTicketClose',
  751                 2 => 'AgentTicketBounce',
  752             },
  753             ReturnType    => 'Action',
  754             ReturnSubType => '-',
  755             Queue         => 'Raw',
  756             UserID        => $UserID,
  757         },
  758         SuccessMatch     => 1,
  759         ReturnActionData => {
  760             1 => 'AgentTicketClose',
  761         },
  762     },
  763     {
  764         Name => 'ACL Action - PossibleNot Data as a Correct Hash using [RegExp]:',
  765         ACLs => {
  766             'Action1' => {
  767                 Properties => {
  768                     Queue => {
  769                         Name => ['Raw'],
  770                     },
  771                 },
  772                 PossibleNot => {
  773                     Action => [ '[RegExp]Close', ],
  774                 },
  775             },
  776         },
  777         Config => {
  778             Data => {
  779                 1 => 'AgentTicketClose',
  780                 2 => 'AgentTicketBounce',
  781             },
  782             ReturnType    => 'Action',
  783             ReturnSubType => '-',
  784             Queue         => 'Raw',
  785             UserID        => $UserID,
  786         },
  787         SuccessMatch     => 1,
  788         ReturnActionData => {
  789             2 => 'AgentTicketBounce',
  790         },
  791     },
  792     {
  793         Name => 'ACL Action - PossibleNot Data as a Correct Hash using [regexp]:',
  794         ACLs => {
  795             'Action1' => {
  796                 Properties => {
  797                     Queue => {
  798                         Name => ['Raw'],
  799                     },
  800                 },
  801                 PossibleNot => {
  802                     Action => [ '[regexp]close', ],
  803                 },
  804             },
  805         },
  806         Config => {
  807             Data => {
  808                 1 => 'AgentTicketClose',
  809                 2 => 'AgentTicketBounce',
  810             },
  811             ReturnType    => 'Action',
  812             ReturnSubType => '-',
  813             Queue         => 'Raw',
  814             UserID        => $UserID,
  815         },
  816         SuccessMatch     => 1,
  817         ReturnActionData => {
  818             2 => 'AgentTicketBounce',
  819         },
  820     },
  821     {
  822         Name => 'ACL Action - PossibleNot Data as a Correct Hash using [NotRegExp]:',
  823         ACLs => {
  824             'Action1' => {
  825                 Properties => {
  826                     Queue => {
  827                         Name => ['Raw'],
  828                     },
  829                 },
  830                 PossibleNot => {
  831                     Action => [ '[NotRegExp]Close', ],
  832                 },
  833             },
  834         },
  835         Config => {
  836             Data => {
  837                 1 => 'AgentTicketClose',
  838                 2 => 'AgentTicketBounce',
  839             },
  840             ReturnType    => 'Action',
  841             ReturnSubType => '-',
  842             Queue         => 'Raw',
  843             UserID        => $UserID,
  844         },
  845         SuccessMatch     => 1,
  846         ReturnActionData => {
  847             1 => 'AgentTicketClose',
  848         },
  849     },
  850     {
  851         Name => 'ACL Action - PossibleNot Data as a Correct Hash using [Notregexp]:',
  852         ACLs => {
  853             'Action1' => {
  854                 Properties => {
  855                     Queue => {
  856                         Name => ['Raw'],
  857                     },
  858                 },
  859                 PossibleNot => {
  860                     Action => [ '[Notregexp]close', ],
  861                 },
  862             },
  863         },
  864         Config => {
  865             Data => {
  866                 1 => 'AgentTicketClose',
  867                 2 => 'AgentTicketBounce',
  868             },
  869             ReturnType    => 'Action',
  870             ReturnSubType => '-',
  871             Queue         => 'Raw',
  872             UserID        => $UserID,
  873         },
  874         SuccessMatch     => 1,
  875         ReturnActionData => {
  876             1 => 'AgentTicketClose',
  877         },
  878     },
  879 
  880     # Possible/PossibleNot tests
  881     {
  882         Name => 'ACL Action - Possible/PossibleNot Data as a Correct Hash:',
  883         ACLs => {
  884             'Action1' => {
  885                 Properties => {
  886                     Queue => {
  887                         Name => ['Raw'],
  888                     },
  889                 },
  890                 Possible => {
  891                     Action => [ 'AgentTicketClose', 'AgentTicketBounce' ],
  892                 },
  893             },
  894             'Action2' => {
  895                 Properties => {
  896                     Queue => {
  897                         Name => ['Raw'],
  898                     },
  899                 },
  900                 PossibleNot => {
  901                     Action => [ 'AgentTicketBounce', ],
  902                 },
  903             },
  904 
  905         },
  906         Config => {
  907             Data => {
  908                 1 => 'AgentTicketClose',
  909                 2 => 'AgentTicketBounce',
  910                 3 => 'AgentTikcetForward',
  911             },
  912             ReturnType    => 'Action',
  913             ReturnSubType => '-',
  914             Queue         => 'Raw',
  915             UserID        => $UserID,
  916         },
  917         SuccessMatch     => 1,
  918         ReturnActionData => {
  919             1 => 'AgentTicketClose',
  920         },
  921     },
  922 
  923     # Possible/PossibleAdd tests
  924     {
  925         Name => 'ACL Action - Possible/PossibleAdd Data as a Correct Hash:',
  926         ACLs => {
  927             'Action1' => {
  928                 Properties => {
  929                     Queue => {
  930                         Name => ['Raw'],
  931                     },
  932                 },
  933                 Possible => {
  934                     Action => [ 'AgentTicketClose', 'AgentTicketBounce' ],
  935                 },
  936             },
  937             'Action2' => {
  938                 Properties => {
  939                     Queue => {
  940                         Name => ['Raw'],
  941                     },
  942                 },
  943                 PossibleAdd => {
  944                     Action => [ 'AgentTicketForward', ],
  945                 },
  946             },
  947 
  948         },
  949         Config => {
  950             Data => {
  951                 1 => 'AgentTicketClose',
  952                 2 => 'AgentTicketBounce',
  953                 3 => 'AgentTicketForward',
  954                 4 => 'AgentTicketCompose',
  955             },
  956             ReturnType    => 'Action',
  957             ReturnSubType => '-',
  958             Queue         => 'Raw',
  959             UserID        => $UserID,
  960         },
  961         SuccessMatch     => 1,
  962         ReturnActionData => {
  963             1 => 'AgentTicketClose',
  964             2 => 'AgentTicketBounce',
  965             3 => 'AgentTicketForward',
  966         },
  967     },
  968 
  969     # Possible/PossibleAdd/PossibleNot tests
  970     {
  971         Name => 'ACL Action - Possible/PossibleAdd/PossibleNot Data as a Correct Hash:',
  972         ACLs => {
  973             'Action1' => {
  974                 Properties => {
  975                     Queue => {
  976                         Name => ['Raw'],
  977                     },
  978                 },
  979                 Possible => {
  980                     Action => [ 'AgentTicketClose', 'AgentTicketBounce' ],
  981                 },
  982             },
  983             'Action2' => {
  984                 Properties => {
  985                     Queue => {
  986                         Name => ['Raw'],
  987                     },
  988                 },
  989                 PossibleAdd => {
  990                     Action => [ 'AgentTicketForward', ],
  991                 },
  992             },
  993             'Action3' => {
  994                 Properties => {
  995                     Queue => {
  996                         Name => ['Raw'],
  997                     },
  998                 },
  999                 PossibleNot => {
 1000                     Action => [ 'AgentTicketClose', ],
 1001                 },
 1002             },
 1003         },
 1004         Config => {
 1005             Data => {
 1006                 1 => 'AgentTicketClose',
 1007                 2 => 'AgentTicketBounce',
 1008                 3 => 'AgentTicketForward',
 1009                 4 => 'AgentTicketCompose',
 1010             },
 1011             ReturnType    => 'Action',
 1012             ReturnSubType => '-',
 1013             Queue         => 'Raw',
 1014             UserID        => $UserID,
 1015         },
 1016         SuccessMatch     => 1,
 1017         ReturnActionData => {
 1018             2 => 'AgentTicketBounce',
 1019             3 => 'AgentTicketForward',
 1020         },
 1021     },
 1022 );
 1023 
 1024 $ExecuteTests->( Tests => \@Tests );
 1025 
 1026 # cleanup is done by RestoreDatabase.
 1027 
 1028 1;