Fix RT#82944
Tomas Doran [Tue, 11 Jun 2013 18:23:28 +0000 (19:23 +0100)]
Changes
t/03-authtest.t
t/04-authsessions.t
t/05-auth-roles-relationship.t
t/06-auth-roles-column.t
t/07-authsessions-cached.t
t/08-simpledb-auth-roles-relationship.t
t/09-simpledb-auth-roles-column.t
t/11-authsessions-load-app-context.t
t/lib/TestApp.pm

diff --git a/Changes b/Changes
index 9f0ea3a..5515f37 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Catalyst-Plugin-Authentication-Store-DBIx-Class
 
-        * Return undef if there isn't a user. This will cause an exception
+       * Fix RT#82944 - test fails on perl >= 5.17.3
+
+       * Return undef if there isn't a user. This will cause an exception
           but a more helpful exception (probably from DBIC) than the inability
           to call a method in this code.
 
index f704281..0ecdc8f 100644 (file)
@@ -19,7 +19,8 @@ BEGIN {
 
     plan tests => 19;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         authentication => {
             default_realm => "users",
@@ -37,11 +38,11 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication/
-    ];
+    );
 }
 
 use Catalyst::Test 'TestApp';
@@ -102,7 +103,7 @@ use Catalyst::Test 'TestApp';
 
 
 {
-    $ENV{TESTAPP_CONFIG}->{authentication}->{realms}->{users}->{store}->{user_model} = 'Nonexistent::Class';
+    TestApp->config->{authentication}->{realms}->{users}->{store}->{user_model} = 'Nonexistent::Class';
     my $res = request('http://localhost/user_login?username=joeuser&password=hackme');
     like( $res->content, qr/\$\Qc->model('Nonexistent::Class') did not return a resultset. Did you set user_model correctly?/, 'test for wrong user_class' );
 }
index 2d649ba..4952ed4 100644 (file)
@@ -33,7 +33,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         authentication => {
             default_realm => "users",
@@ -52,15 +53,15 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Session
            Session::Store::Dummy
            Session::State::Cookie
            /
-    ];
+    );
 }
 
 use Test::WWW::Mechanize::Catalyst 'TestApp';
index 55da53c..7b5f1c8 100644 (file)
@@ -23,7 +23,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         authentication => {
             default_realm => "users",
@@ -43,13 +44,13 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Authorization::Roles
            /
-    ];
+    );
 }
 
 use Catalyst::Test 'TestApp';
index 70f5643..a021fca 100644 (file)
@@ -23,7 +23,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         authentication => {
             default_realm => "users",
@@ -42,13 +43,13 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Authorization::Roles
            /
-    ];
+    );
 }
 
 use Catalyst::Test 'TestApp';
index 745bf95..2c8b1d3 100644 (file)
@@ -33,7 +33,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         authentication => {
             default_realm => "users",
@@ -52,15 +53,15 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Session
            Session::Store::Dummy
            Session::State::Cookie
            /
-    ];
+    );
 }
 
 use Test::WWW::Mechanize::Catalyst 'TestApp';
index d5251e1..25b85e7 100644 (file)
@@ -23,7 +23,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         'Plugin::Authentication' => {
             default => {
@@ -32,13 +33,13 @@ BEGIN {
                 password_type => 'clear'
                        }
                }
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Authorization::Roles
            /
-    ];
+    );
 }
 
 use Catalyst::Test 'TestApp';
index bced500..b13494f 100644 (file)
@@ -23,7 +23,8 @@ BEGIN {
 
     plan tests => 8;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',
         'Plugin::Authentication' => {
             default => {
@@ -34,13 +35,13 @@ BEGIN {
                        }
                }
 
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
            Authorization::Roles
            /
-    ];
+    );
 }
 
 use Catalyst::Test 'TestApp';
index e458c9f..7cc2e77 100644 (file)
@@ -33,7 +33,8 @@ BEGIN {
 
     plan tests => 4;
 
-    $ENV{TESTAPP_CONFIG} = {
+    use TestApp;
+    TestApp->config( {
         name => 'TestApp',     
         authentication => {
             default_realm => "users",
@@ -50,15 +51,15 @@ BEGIN {
                 },
             },
         },
-    };
+    } );
 
-    $ENV{TESTAPP_PLUGINS} = [
+    TestApp->setup(
         qw/Authentication
             Session
                    Session::Store::Dummy                  
             Session::State::Cookie                              
            /
-    ];
+    );
 }
 
 use Test::WWW::Mechanize::Catalyst 'TestApp';
index 619b4dd..a58b02a 100644 (file)
@@ -4,8 +4,4 @@ use strict;
 use Catalyst;
 use Data::Dumper;
 
-TestApp->config( $ENV{TESTAPP_CONFIG} );
-
-TestApp->setup( @{$ENV{TESTAPP_PLUGINS}} );
-
 1;