[Rt-commit] rtir branch, 3.2-trunk, updated. 3.2.0-17-gc7218ddb

? sunnavy sunnavy at bestpractical.com
Fri Mar 23 11:49:20 EDT 2018


The branch, 3.2-trunk has been updated
       via  c7218ddb70b018e20f04f9f59bf0f675564039f2 (commit)
      from  00759ec0970a3e2a5a394d665871e16773cc06f0 (commit)

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

- Log -----------------------------------------------------------------
commit c7218ddb70b018e20f04f9f59bf0f675564039f2
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 ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' )
    
    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 4fcba862..6a64414e 100644
--- a/t/articles/on-create.t
+++ b/t/articles/on-create.t
@@ -34,9 +34,9 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
     is($agent->status, 200, "attempt to create succeeded");
 }
 
-foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+foreach my $q_name ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
     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