"Fossies" - the Fresh Open Source Software Archive

Member "otrs-5.0.40/scripts/test/ProcessManagement/ActivityDialog.t" (12 Dec 2019, 31260 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 "ActivityDialog.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 use Kernel::System::VariableCheck qw(:all);
   16 
   17 # get needed objects
   18 my $ConfigObject         = $Kernel::OM->Get('Kernel::Config');
   19 my $ActivityDialogObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::ActivityDialog');
   20 
   21 # define needed variables
   22 my $RandomID = $Kernel::OM->Get('Kernel::System::UnitTest::Helper')->GetRandomID();
   23 
   24 # ActivityDialogGet() tests
   25 my @Tests = (
   26     {
   27         Name            => 'No Interface',
   28         ActivityDialogs => {
   29             'AD1' . $RandomID => {
   30                 Interface => ['AgentInterface'],
   31             },
   32         },
   33         Config  => {},
   34         Success => 0,
   35     },
   36     {
   37         Name            => 'Interface allowed: Agent / Interface used: Agent',
   38         ActivityDialogs => {
   39             'AD1' . $RandomID => {
   40                 Interface => ['AgentInterface'],
   41             },
   42         },
   43         Config => {
   44             Interface              => 'AgentInterface',
   45             ActivityDialogEntityID => 'AD1' . $RandomID,
   46         },
   47         Success => 1,
   48     },
   49     {
   50         Name            => 'Interface allowed: Customer / Interface used: Customer',
   51         ActivityDialogs => {
   52             'AD1' . $RandomID => {
   53                 Interface => ['CustomerInterface'],
   54             },
   55         },
   56         Config => {
   57             Interface              => 'CustomerInterface',
   58             ActivityDialogEntityID => 'AD1' . $RandomID,
   59         },
   60         Success => 1,
   61     },
   62     {
   63         Name            => 'Interface allowed: Agent / Interface used: Customer',
   64         ActivityDialogs => {
   65             'AD1' . $RandomID => {
   66                 Interface => ['AgentInterface'],
   67             },
   68         },
   69         Config => {
   70             Interface              => 'CustomerInterface',
   71             ActivityDialogEntityID => 'AD1' . $RandomID,
   72         },
   73         Success => 0,
   74     },
   75     {
   76         Name            => 'Interface allowed: Customer / Interface used: Agent',
   77         ActivityDialogs => {
   78             'AD1' . $RandomID => {
   79                 Interface => ['CustomerInterface'],
   80             },
   81         },
   82         Config => {
   83             Interface              => 'AgentInterface',
   84             ActivityDialogEntityID => 'AD1' . $RandomID,
   85         },
   86         Success => 0,
   87     },
   88     {
   89         Name            => 'Interface allowed: Agent+Customer / Interface used: Agent',
   90         ActivityDialogs => {
   91             'AD1' . $RandomID => {
   92                 Interface => [ 'AgentInterface', 'CustomerInterface' ],
   93             },
   94         },
   95         Config => {
   96             Interface              => 'AgentInterface',
   97             ActivityDialogEntityID => 'AD1' . $RandomID,
   98         },
   99         Success => 1,
  100     },
  101     {
  102         Name            => 'Interface allowed: Agent+Customer / Interface used: Customer',
  103         ActivityDialogs => {
  104             'AD1' . $RandomID => {
  105                 Interface => [ 'AgentInterface', 'CustomerInterface' ],
  106             },
  107         },
  108         Config => {
  109             Interface              => 'CustomerInterface',
  110             ActivityDialogEntityID => 'AD1' . $RandomID,
  111         },
  112         Success => 1,
  113     },
  114     {
  115         Name            => 'No Parameters',
  116         ActivityDialogs => {
  117             'AD1' . $RandomID => {
  118                 Interface        => ['AgentInterface'],
  119                 Name             => 'Activity Dialog 1',
  120                 DescriptionShort => 'AD1 Process Short',
  121                 DescriptionLong  => 'AD1 Process Long description',
  122                 CreateTime       => '07-02-2012 13:37:00',
  123                 CreateBy         => '2',
  124                 ChangeTime       => '08-02-2012 13:37:00',
  125                 ChangeBy         => '3',
  126                 Fields           => {
  127                     DynamicField_Make => {
  128                         Display          => 2,
  129                         DescriptionLong  => 'Make Long',
  130                         DescriptionShort => 'Make Short',
  131                     },
  132                     DynamicField_VWModel => {
  133                         Display          => 2,
  134                         DescriptionLong  => 'VWModel Long',
  135                         DescriptionShort => 'VWModel Short',
  136                     },
  137                     DynamicField_PeugeotModel => {
  138                         Display          => 0,
  139                         DescriptionLong  => 'PeugeotModel Long',
  140                         DescriptionShort => 'PeugeotModel Short',
  141                     },
  142                     StateID => {
  143                         Display          => 1,
  144                         DescriptionLong  => 'StateID Long',
  145                         DescriptionShort => 'StateID Short',
  146                     },
  147                 },
  148                 FieldOrder => [
  149                     'StateID',
  150                     'DynamicField_Make',
  151                     'DynamicField_VWModelModel',
  152                     'DynamicField_PeugeotModel',
  153                 ],
  154                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  155                 SubmitButtonText => 'Make an inquiry',
  156             },
  157         },
  158         Config => {
  159             Interface => 'AgentInterface',
  160         },
  161         Success => 0,
  162     },
  163     {
  164         Name            => 'No ActivityDialogEntityID',
  165         ActivityDialogs => {
  166             'AD1' . $RandomID => {
  167                 Interface        => ['AgentInterface'],
  168                 Name             => 'Activity Dialog 1',
  169                 DescriptionShort => 'AD1 Process Short',
  170                 DescriptionLong  => 'AD1 Process Long description',
  171                 CreateTime       => '07-02-2012 13:37:00',
  172                 CreateBy         => '2',
  173                 ChangeTime       => '08-02-2012 13:37:00',
  174                 ChangeBy         => '3',
  175                 Fields           => {
  176                     DynamicField_Make => {
  177                         Display          => 2,
  178                         DescriptionLong  => 'Make Long',
  179                         DescriptionShort => 'Make Short',
  180                     },
  181                     DynamicField_VWModel => {
  182                         Display          => 2,
  183                         DescriptionLong  => 'VWModel Long',
  184                         DescriptionShort => 'VWModel Short',
  185                     },
  186                     DynamicField_PeugeotModel => {
  187                         Display          => 0,
  188                         DescriptionLong  => 'PeugeotModel Long',
  189                         DescriptionShort => 'PeugeotModel Short',
  190                     },
  191                     StateID => {
  192                         Display          => 1,
  193                         DescriptionLong  => 'StateID Long',
  194                         DescriptionShort => 'StateID Short',
  195                     },
  196                 },
  197                 FieldOrder => [
  198                     'StateID',
  199                     'DynamicField_Make',
  200                     'DynamicField_VWModelModel',
  201                     'DynamicField_PeugeotModel',
  202                 ],
  203                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  204                 SubmitButtonText => 'Make an inquiry',
  205             },
  206         },
  207         Config => {
  208             Interface => 'AgentInterface',
  209             Other     => 1,
  210         },
  211         Success => 0,
  212     },
  213     {
  214         Name            => 'Wrong ActivityDialogEntityID',
  215         ActivityDialogs => {
  216             'AD1' . $RandomID => {
  217                 Interface        => ['AgentInterface'],
  218                 Name             => 'Activity Dialog 1',
  219                 DescriptionShort => 'AD1 Process Short',
  220                 DescriptionLong  => 'AD1 Process Long description',
  221                 CreateTime       => '07-02-2012 13:37:00',
  222                 CreateBy         => '2',
  223                 ChangeTime       => '08-02-2012 13:37:00',
  224                 ChangeBy         => '3',
  225                 Fields           => {
  226                     DynamicField_Make => {
  227                         Display          => 2,
  228                         DescriptionLong  => 'Make Long',
  229                         DescriptionShort => 'Make Short',
  230                     },
  231                     DynamicField_VWModel => {
  232                         Display          => 2,
  233                         DescriptionLong  => 'VWModel Long',
  234                         DescriptionShort => 'VWModel Short',
  235                     },
  236                     DynamicField_PeugeotModel => {
  237                         Display          => 0,
  238                         DescriptionLong  => 'PeugeotModel Long',
  239                         DescriptionShort => 'PeugeotModel Short',
  240                     },
  241                     StateID => {
  242                         Display          => 1,
  243                         DescriptionLong  => 'StateID Long',
  244                         DescriptionShort => 'StateID Short',
  245                     },
  246                 },
  247                 FieldOrder => [
  248                     'StateID',
  249                     'DynamicField_Make',
  250                     'DynamicField_VWModelModel',
  251                     'DynamicField_PeugeotModel',
  252                 ],
  253                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  254                 SubmitButtonText => 'Make an inquiry',
  255             },
  256         },
  257         Config => {
  258             Interface              => 'AgentInterface',
  259             ActivityDialogEntityID => 'Notexisiting' . $RandomID,
  260         },
  261         Success => 0,
  262     },
  263     {
  264         Name            => 'No ActivityDialogs Configuration',
  265         ActivityDialogs => {},
  266         Config          => {
  267             Interface              => 'AgentInterface',
  268             ActivityDialogEntityID => 'Notexisiting' . $RandomID,
  269         },
  270         Success => 0,
  271     },
  272     {
  273         Name            => 'Correct ASCII',
  274         ActivityDialogs => {
  275             'AD1' . $RandomID => {
  276                 Interface        => ['AgentInterface'],
  277                 Name             => 'Activity Dialog 1',
  278                 DescriptionShort => 'AD1 Process Short',
  279                 DescriptionLong  => 'AD1 Process Long description',
  280                 CreateTime       => '07-02-2012 13:37:00',
  281                 CreateBy         => '2',
  282                 ChangeTime       => '08-02-2012 13:37:00',
  283                 ChangeBy         => '3',
  284                 Fields           => {
  285                     DynamicField_Make => {
  286                         Display          => 2,
  287                         DescriptionLong  => 'Make Long',
  288                         DescriptionShort => 'Make Short',
  289                     },
  290                     DynamicField_VWModel => {
  291                         Display          => 2,
  292                         DescriptionLong  => 'VWModel Long',
  293                         DescriptionShort => 'VWModel Short',
  294                     },
  295                     DynamicField_PeugeotModel => {
  296                         Display          => 0,
  297                         DescriptionLong  => 'PeugeotModel Long',
  298                         DescriptionShort => 'PeugeotModel Short',
  299                     },
  300                     StateID => {
  301                         Display          => 1,
  302                         DescriptionLong  => 'StateID Long',
  303                         DescriptionShort => 'StateID Short',
  304                     },
  305                 },
  306                 FieldOrder => [
  307                     'StateID',
  308                     'DynamicField_Make',
  309                     'DynamicField_VWModelModel',
  310                     'DynamicField_PeugeotModel',
  311                 ],
  312                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  313                 SubmitButtonText => 'Make an inquiry',
  314             },
  315         },
  316         Config => {
  317             Interface              => 'AgentInterface',
  318             ActivityDialogEntityID => 'AD1' . $RandomID,
  319         },
  320         Success => 1,
  321     },
  322     {
  323         Name            => 'Correct UTF8',
  324         ActivityDialogs => {
  325             'AD1' . $RandomID => {
  326                 Interface => ['AgentInterface'],
  327                 Name =>
  328                     'äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  329                 DescriptionShort =>
  330                     'AD1 äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  331                 DescriptionLong =>
  332                     'AD1 äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  333                 CreateTime => '07-02-2012 13:37:00',
  334                 CreateBy   => '2',
  335                 ChangeTime => '08-02-2012 13:37:00',
  336                 ChangeBy   => '3',
  337                 Fields     => {
  338                     DynamicField_Make => {
  339                         Display => 2,
  340                         DescriptionLong =>
  341                             'Make äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  342                         DescriptionShort => 'Make Short',
  343                     },
  344                     DynamicField_VWModel => {
  345                         Display         => 2,
  346                         DescriptionLong => 'VWModel Long',
  347                         DescriptionShort =>
  348                             'VWModel äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  349                     },
  350                     DynamicField_PeugeotModel => {
  351                         Display => 0,
  352                         DescriptionLong =>
  353                             'PeugeotModel äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  354                         DescriptionShort => 'PeugeotModel Short',
  355                     },
  356                     StateID => {
  357                         Display         => 1,
  358                         DescriptionLong => 'StateID Long',
  359                         DescriptionShort =>
  360                             'StateID äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  361                     },
  362                 },
  363                 FieldOrder => [
  364                     'StateID',
  365                     'DynamicField_Make',
  366                     'DynamicField_VWModelModel',
  367                     'DynamicField_PeugeotModel',
  368                 ],
  369                 SubmitAdviceText =>
  370                     'NOTE: äöüßÄÖÜ€исáéíúóúÁÉÍÓÚñÑ-カスタ-用迎使用-Язык',
  371                 SubmitButtonText => 'Make an inquiry',
  372             },
  373         },
  374         Config => {
  375             Interface              => 'AgentInterface',
  376             ActivityDialogEntityID => 'AD1' . $RandomID,
  377         },
  378         Success => 1,
  379     },
  380 );
  381 
  382 for my $Test (@Tests) {
  383 
  384     # set activity dialog config
  385     $ConfigObject->Set(
  386         Key   => 'Process::ActivityDialog',
  387         Value => $Test->{ActivityDialogs},
  388     );
  389 
  390     # get activity dialog described in test
  391     my $ActivityDialog = $ActivityDialogObject->ActivityDialogGet( %{ $Test->{Config} } );
  392 
  393     if ( $Test->{Success} ) {
  394         $Self->IsNot(
  395             $ActivityDialog,
  396             undef,
  397             "ActivityDialogGet() Test:'$Test->{Name}' | should not be undef"
  398         );
  399         $Self->Is(
  400             ref $ActivityDialog,
  401             'HASH',
  402             "ActivityDialogGet() Test:'$Test->{Name}' | should be a HASH"
  403         );
  404         $Self->IsDeeply(
  405             $ActivityDialog,
  406             $Test->{ActivityDialogs}->{ $Test->{Config}->{ActivityDialogEntityID} },
  407             "ActivityDialogGet() Test:'$Test->{Name}' | comparison"
  408         );
  409     }
  410     else {
  411         $Self->Is(
  412             $ActivityDialog,
  413             undef,
  414             "ActivityDialogGet() Test:'$Test->{Name}' | should be undef"
  415         );
  416     }
  417 }
  418 
  419 # ActivityDialogCompletedCheck() tests
  420 @Tests = (
  421     {
  422         Name            => 'No Parameters',
  423         ActivityDialogs => {
  424             'AD1' . $RandomID => {
  425                 Interface        => ['AgentInterface'],
  426                 Name             => 'Activity Dialog 1',
  427                 DescriptionShort => 'AD1 Process Short',
  428                 DescriptionLong  => 'AD1 Process Long description',
  429                 CreateTime       => '07-02-2012 13:37:00',
  430                 CreateBy         => '2',
  431                 ChangeTime       => '08-02-2012 13:37:00',
  432                 ChangeBy         => '3',
  433                 Fields           => {
  434                     DynamicField_Make => {
  435                         Display          => 0,
  436                         DescriptionLong  => 'Make Long',
  437                         DescriptionShort => 'Make Short',
  438                     },
  439                     DynamicField_VWModel => {
  440                         Display          => 1,
  441                         DescriptionLong  => 'VWModel Long',
  442                         DescriptionShort => 'VWModel Short',
  443                     },
  444                     StateID => {
  445                         Display          => 2,
  446                         DescriptionLong  => 'StateID Long',
  447                         DescriptionShort => 'StateID Short',
  448                     },
  449                 },
  450                 FieldOrder => [
  451                     'StateID',
  452                     'DynamicField_Make',
  453                     'DynamicField_VWModelModel',
  454                 ],
  455                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  456                 SubmitButtonText => 'Make an inquiry',
  457             },
  458         },
  459         Config => {
  460             Interface => 'AgentInterface',
  461         },
  462         Success => 0,
  463     },
  464     {
  465         Name            => 'No ActivityDialogEntityID',
  466         ActivityDialogs => {
  467             'AD1' . $RandomID => {
  468                 Interface        => ['AgentInterface'],
  469                 Name             => 'Activity Dialog 1',
  470                 DescriptionShort => 'AD1 Process Short',
  471                 DescriptionLong  => 'AD1 Process Long description',
  472                 CreateTime       => '07-02-2012 13:37:00',
  473                 CreateBy         => '2',
  474                 ChangeTime       => '08-02-2012 13:37:00',
  475                 ChangeBy         => '3',
  476                 Fields           => {
  477                     DynamicField_Make => {
  478                         Display          => 0,
  479                         DescriptionLong  => 'Make Long',
  480                         DescriptionShort => 'Make Short',
  481                     },
  482                     DynamicField_VWModel => {
  483                         Display          => 1,
  484                         DescriptionLong  => 'VWModel Long',
  485                         DescriptionShort => 'VWModel Short',
  486                     },
  487                     StateID => {
  488                         Display          => 2,
  489                         DescriptionLong  => 'StateID Long',
  490                         DescriptionShort => 'StateID Short',
  491                     },
  492                 },
  493                 FieldOrder => [
  494                     'StateID',
  495                     'DynamicField_Make',
  496                     'DynamicField_VWModelModel',
  497                 ],
  498                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  499                 SubmitButtonText => 'Make an inquiry',
  500             },
  501         },
  502         Config => {
  503             Interface              => 'AgentInterface',
  504             ActivityDialogEntityID => undef,
  505             Data                   => {
  506                 DynamicField_Make    => 'VW',
  507                 DynamicField_VWModel => 'Golf',
  508                 StateID              => 1,
  509             },
  510         },
  511         Success => 0,
  512     },
  513     {
  514         Name            => 'No Data',
  515         ActivityDialogs => {
  516             'AD1' . $RandomID => {
  517                 Interface        => ['AgentInterface'],
  518                 Name             => 'Activity Dialog 1',
  519                 DescriptionShort => 'AD1 Process Short',
  520                 DescriptionLong  => 'AD1 Process Long description',
  521                 CreateTime       => '07-02-2012 13:37:00',
  522                 CreateBy         => '2',
  523                 ChangeTime       => '08-02-2012 13:37:00',
  524                 ChangeBy         => '3',
  525                 Fields           => {
  526                     DynamicField_Make => {
  527                         Display          => 0,
  528                         DescriptionLong  => 'Make Long',
  529                         DescriptionShort => 'Make Short',
  530                     },
  531                     DynamicField_VWModel => {
  532                         Display          => 1,
  533                         DescriptionLong  => 'VWModel Long',
  534                         DescriptionShort => 'VWModel Short',
  535                     },
  536                     StateID => {
  537                         Display          => 2,
  538                         DescriptionLong  => 'StateID Long',
  539                         DescriptionShort => 'StateID Short',
  540                     },
  541                 },
  542                 FieldOrder => [
  543                     'StateID',
  544                     'DynamicField_Make',
  545                     'DynamicField_VWModelModel',
  546                 ],
  547                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  548                 SubmitButtonText => 'Make an inquiry',
  549             },
  550         },
  551         Config => {
  552             Interface              => 'AgentInterface',
  553             ActivityDialogEntityID => 'AD1' . $RandomID,
  554             Data                   => undef,
  555         },
  556         Success => 0,
  557     },
  558     {
  559         Name            => 'Wong Data Format',
  560         ActivityDialogs => {
  561             'AD1' . $RandomID => {
  562                 Interface        => ['AgentInterface'],
  563                 Name             => 'Activity Dialog 1',
  564                 DescriptionShort => 'AD1 Process Short',
  565                 DescriptionLong  => 'AD1 Process Long description',
  566                 CreateTime       => '07-02-2012 13:37:00',
  567                 CreateBy         => '2',
  568                 ChangeTime       => '08-02-2012 13:37:00',
  569                 ChangeBy         => '3',
  570                 Fields           => {
  571                     DynamicField_Make => {
  572                         Display          => 0,
  573                         DescriptionLong  => 'Make Long',
  574                         DescriptionShort => 'Make Short',
  575                     },
  576                     DynamicField_VWModel => {
  577                         Display          => 1,
  578                         DescriptionLong  => 'VWModel Long',
  579                         DescriptionShort => 'VWModel Short',
  580                     },
  581                     StateID => {
  582                         Display          => 2,
  583                         DescriptionLong  => 'StateID Long',
  584                         DescriptionShort => 'StateID Short',
  585                     },
  586                 },
  587                 FieldOrder => [
  588                     'StateID',
  589                     'DynamicField_Make',
  590                     'DynamicField_VWModelModel',
  591                 ],
  592                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  593                 SubmitButtonText => 'Make an inquiry',
  594             },
  595         },
  596         Config => {
  597             Interface              => 'AgentInterface',
  598             ActivityDialogEntityID => 'AD1' . $RandomID,
  599             Data                   => 1,
  600         },
  601         Success => 0,
  602     },
  603     {
  604         Name            => 'No Fields in ActivityDialog Config',
  605         ActivityDialogs => {
  606             'AD1' . $RandomID => {
  607                 Interface        => ['AgentInterface'],
  608                 Name             => 'Activity Dialog 1',
  609                 DescriptionShort => 'AD1 Process Short',
  610                 DescriptionLong  => 'AD1 Process Long description',
  611                 CreateTime       => '07-02-2012 13:37:00',
  612                 CreateBy         => '2',
  613                 ChangeTime       => '08-02-2012 13:37:00',
  614                 ChangeBy         => '3',
  615                 Fields           => 1,
  616                 FieldOrder       => [
  617                     'StateID',
  618                     'DynamicField_Make',
  619                     'DynamicField_VWModelModel',
  620                 ],
  621                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  622                 SubmitButtonText => 'Make an inquiry',
  623             },
  624         },
  625         Config => {
  626             Interface              => 'AgentInterface',
  627             ActivityDialogEntityID => 'AD1' . $RandomID,
  628             Data                   => {
  629                 DynamicField_Make    => 'VW',
  630                 DynamicField_VWModel => 'Golf',
  631                 StateID              => 1,
  632             },
  633         },
  634         Success => 0,
  635     },
  636     {
  637         Name            => 'No Data for Required Field',
  638         ActivityDialogs => {
  639             'AD1' . $RandomID => {
  640                 Interface        => ['AgentInterface'],
  641                 Name             => 'Activity Dialog 1',
  642                 DescriptionShort => 'AD1 Process Short',
  643                 DescriptionLong  => 'AD1 Process Long description',
  644                 CreateTime       => '07-02-2012 13:37:00',
  645                 CreateBy         => '2',
  646                 ChangeTime       => '08-02-2012 13:37:00',
  647                 ChangeBy         => '3',
  648                 Fields           => {
  649                     DynamicField_Make => {
  650                         Display          => 0,
  651                         DescriptionLong  => 'Make Long',
  652                         DescriptionShort => 'Make Short',
  653                     },
  654                     DynamicField_VWModel => {
  655                         Display          => 1,
  656                         DescriptionLong  => 'VWModel Long',
  657                         DescriptionShort => 'VWModel Short',
  658                     },
  659                     StateID => {
  660                         Display          => 2,
  661                         DescriptionLong  => 'StateID Long',
  662                         DescriptionShort => 'StateID Short',
  663                     },
  664                 },
  665                 FieldOrder => [
  666                     'StateID',
  667                     'DynamicField_Make',
  668                     'DynamicField_VWModelModel',
  669                 ],
  670                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  671                 SubmitButtonText => 'Make an inquiry',
  672             },
  673         },
  674         Config => {
  675             Interface              => 'AgentInterface',
  676             ActivityDialogEntityID => 'AD1' . $RandomID,
  677             Data                   => {
  678                 DynamicField_Make    => 'VW',
  679                 DynamicField_VWModel => 'Golf',
  680                 StateID              => '',
  681             },
  682         },
  683         Success => 0,
  684     },
  685     {
  686         Name            => 'Correct,  Data for Required Field',
  687         ActivityDialogs => {
  688             'AD1' . $RandomID => {
  689                 Interface        => ['AgentInterface'],
  690                 Name             => 'Activity Dialog 1',
  691                 DescriptionShort => 'AD1 Process Short',
  692                 DescriptionLong  => 'AD1 Process Long description',
  693                 CreateTime       => '07-02-2012 13:37:00',
  694                 CreateBy         => '2',
  695                 ChangeTime       => '08-02-2012 13:37:00',
  696                 ChangeBy         => '3',
  697                 Fields           => {
  698                     DynamicField_Make => {
  699                         Display          => 0,
  700                         DescriptionLong  => 'Make Long',
  701                         DescriptionShort => 'Make Short',
  702                     },
  703                     DynamicField_VWModel => {
  704                         Display          => 1,
  705                         DescriptionLong  => 'VWModel Long',
  706                         DescriptionShort => 'VWModel Short',
  707                     },
  708                     StateID => {
  709                         Display          => 2,
  710                         DescriptionLong  => 'StateID Long',
  711                         DescriptionShort => 'StateID Short',
  712                     },
  713                 },
  714                 FieldOrder => [
  715                     'StateID',
  716                     'DynamicField_Make',
  717                     'DynamicField_VWModelModel',
  718                 ],
  719                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  720                 SubmitButtonText => 'Make an inquiry',
  721             },
  722         },
  723         Config => {
  724             Interface              => 'AgentInterface',
  725             ActivityDialogEntityID => 'AD1' . $RandomID,
  726             Data                   => {
  727                 DynamicField_Make    => 'VW',
  728                 DynamicField_VWModel => 'Golf',
  729                 StateID              => 1,
  730             },
  731         },
  732         Success => 1,
  733     },
  734     {
  735         Name            => 'Correct,  No Required Field',
  736         ActivityDialogs => {
  737             'AD1' . $RandomID => {
  738                 Interface        => ['AgentInterface'],
  739                 Name             => 'Activity Dialog 1',
  740                 DescriptionShort => 'AD1 Process Short',
  741                 DescriptionLong  => 'AD1 Process Long description',
  742                 CreateTime       => '07-02-2012 13:37:00',
  743                 CreateBy         => '2',
  744                 ChangeTime       => '08-02-2012 13:37:00',
  745                 ChangeBy         => '3',
  746                 Fields           => {
  747                     DynamicField_Make => {
  748                         Display          => 0,
  749                         DescriptionLong  => 'Make Long',
  750                         DescriptionShort => 'Make Short',
  751                     },
  752                     DynamicField_VWModel => {
  753                         Display          => 1,
  754                         DescriptionLong  => 'VWModel Long',
  755                         DescriptionShort => 'VWModel Short',
  756                     },
  757                     StateID => {
  758                         Display          => 1,
  759                         DescriptionLong  => 'StateID Long',
  760                         DescriptionShort => 'StateID Short',
  761                     },
  762                 },
  763                 FieldOrder => [
  764                     'StateID',
  765                     'DynamicField_Make',
  766                     'DynamicField_VWModelModel',
  767                 ],
  768                 SubmitAdviceText => 'NOTE: If you submit the form ...',
  769                 SubmitButtonText => 'Make an inquiry',
  770             },
  771         },
  772         Config => {
  773             Interface              => 'AgentInterface',
  774             ActivityDialogEntityID => 'AD1' . $RandomID,
  775             Data                   => {
  776                 DynamicField_Make    => '',
  777                 DynamicField_VWModel => '',
  778                 StateID              => '',
  779             },
  780         },
  781         Success => 1,
  782     },
  783 );
  784 
  785 for my $Test (@Tests) {
  786 
  787     # set activity dialog config
  788     $ConfigObject->Set(
  789         Key   => 'Process::ActivityDialog',
  790         Value => $Test->{ActivityDialogs},
  791     );
  792 
  793     # get activity dialog described in test
  794     my $CheckSuccess = $ActivityDialogObject->ActivityDialogCompletedCheck( %{ $Test->{Config} } );
  795 
  796     if ( $Test->{Success} ) {
  797         $Self->True(
  798             $CheckSuccess,
  799             "ActivityDialogCompletedCheck() Test:'$Test->{Name}' | with True",
  800         );
  801     }
  802     else {
  803         $Self->False(
  804             $CheckSuccess,
  805             "ActivityDialogCompletedCheck() Test:'$Test->{Name}' | with False",
  806         );
  807     }
  808 }
  809 
  810 1;