[Bps-public-commit] rt-extension-rest2 branch, move-test-files, updated. 1.06-11-g7d7c40a

? sunnavy sunnavy at bestpractical.com
Fri May 10 11:11:27 EDT 2019


The branch, move-test-files has been updated
       via  7d7c40a85358d1e7dce115cdbd21d6340255f95a (commit)
      from  5b6e2f52969ffd1bfe648f89343779a319d3b22a (commit)

Summary of changes:
 lib/RT/Extension/REST2/Test.pm.in | 1 -
 1 file changed, 1 deletion(-)

- Log -----------------------------------------------------------------
commit 7d7c40a85358d1e7dce115cdbd21d6340255f95a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri May 10 22:57:39 2019 +0800

    Don't "use" record classes in Test.pm
    
    "use RT::User" requires RT::Record, which calls RT->Config->Get('RecordBaseClass').
    
    RT::Config is defined as:
    
        sub Config { return $Config || shift->LoadConfig(); }
    
    Thus, "use RT::User" here accidentally results in "RT->LoadConfig",
    before test env being set up in RT::Test::import, so it loads default RT
    site configs, which is wrong.
    
    We actually don't need to require RT::User here either because RT->Init
    will load it automatically.

diff --git a/lib/RT/Extension/REST2/Test.pm.in b/lib/RT/Extension/REST2/Test.pm.in
index 8ac8f3c..3ff37c7 100644
--- a/lib/RT/Extension/REST2/Test.pm.in
+++ b/lib/RT/Extension/REST2/Test.pm.in
@@ -8,7 +8,6 @@ use lib qw(/opt/rt4/local/lib /opt/rt4/lib);
 
 use base 'RT::Test';
 use Test::WWW::Mechanize::PSGI;
-use RT::User;
 
 sub import {
     my $class = shift;

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


More information about the Bps-public-commit mailing list