[Rt-commit] rtir branch, 4.0/pass-tests, updated. 4.0.1rc1-41-gd1fc4ecd

? sunnavy sunnavy at bestpractical.com
Thu Mar 8 09:03:31 EST 2018


The branch, 4.0/pass-tests has been updated
       via  d1fc4ecda71e62ab1f8cf30f01df039f1fb17395 (commit)
      from  24d301f20b6fbc652b132fb5412ba05f503e5dc5 (commit)

Summary of changes:
 t/articles/on-create.t | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit d1fc4ecda71e62ab1f8cf30f01df039f1fb17395
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Mar 8 21:36:29 2018 +0800

    Use lexical iterator so inline test server can render articles
    
    In RT's /Articles/Article/Elements/Preformatted, there is code using
    global $_ as while/foreach iterator, unfortunately the foreach loop in
    test assigns $_ to constants:
    
        foreach ( 'Incident Reports', 'Investigations', 'Countermeasures' )
    
    So $_ becomes readonly inside the loop. As the test shares the same perl
    process with inline server, server dies with error message "Modification
    of a read-only value attempted"

diff --git a/t/articles/on-create.t b/t/articles/on-create.t
index a3a51469..b319f530 100644
--- a/t/articles/on-create.t
+++ b/t/articles/on-create.t
@@ -36,10 +36,10 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
 }
 
 # TODO: Once incident+investigation creation is re-added, this should be put back
-#foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
-foreach ( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
+#foreach my $q_name ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
+foreach my $q_name ( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
     my $queue = RT::Queue->new(RT->SystemUser);
-    $queue->Load( $_ );
+    $queue->Load( $q_name );
     ok $agent->goto_create_ticket( $queue ), "UI -> create ticket";
 
     my $content_name = $queue->Name eq 'Incidents'? 'InvestigationContent': 'Content';

-----------------------------------------------------------------------


More information about the rt-commit mailing list