X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FTest.pm;h=3a8e33892469d84f40e953867bab924cec7fcb90;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=6afb31192ccc408687d4670e73aacffef52733ee;hpb=1c538bfabc2cd31f27067505f0c3d1a46cba6ef0;p=freeside.git diff --git a/rt/lib/RT/Test.pm b/rt/lib/RT/Test.pm index 6afb31192..3a8e33892 100644 --- a/rt/lib/RT/Test.pm +++ b/rt/lib/RT/Test.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -886,7 +886,7 @@ sub create_ticket { $args{'MIMEObj'} = MIME::Entity->build( From => Encode::encode( "UTF-8", $args{'Requestor'} ), Subject => RT::Interface::Email::EncodeToMIME( String => $args{'Subject'} ), - Type => $args{ContentType} // "text/plain", + Type => (defined $args{ContentType} ? $args{ContentType} : "text/plain"), Charset => "UTF-8", Data => Encode::encode( "UTF-8", $content ), ); @@ -1718,9 +1718,9 @@ sub file_content { } sub find_executable { - my $self = shift; + my ( $self, $exe ) = @_; - return File::Which::which( @_ ); + return File::Which::which( $exe ); } sub diag { @@ -1733,7 +1733,9 @@ sub parse_mail { require RT::EmailParser; my $parser = RT::EmailParser->new; $parser->ParseMIMEEntityFromScalar( $mail ); - return $parser->Entity; + my $entity = $parser->Entity; + $entity->{__store_link_to_object_to_avoid_early_cleanup} = $parser; + return $entity; } sub works {