[Rt-commit] rt branch 6.0/fix-session-tests created. rt-5.0.3-502-g437f3a54e5

BPS Git Server git at git.bestpractical.com
Wed Apr 26 21:45:25 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 6.0/fix-session-tests has been created
        at  437f3a54e587097de217d6c4d15068d30db9416e (commit)

- Log -----------------------------------------------------------------
commit 437f3a54e587097de217d6c4d15068d30db9416e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Apr 27 05:41:41 2023 +0800

    Pass specific %session variable in session tests
    
    We use the variable instead of the default
    %HTML::Mason::Commands::session to test various things.

diff --git a/t/web/session.t b/t/web/session.t
index a04b287160..ef601d3778 100644
--- a/t/web/session.t
+++ b/t/web/session.t
@@ -37,7 +37,8 @@ my ($session_id) = $agent->cookie_jar->as_string =~ /RT_SID_[^=]+=(\w+);/;
 diag 'Load session for root user';
 my %session;
 RT::Interface::Web::Session::Load(
-    Id => $session_id,
+    Ref => \%session,
+    Id  => $session_id,
 );
 
 is ( $session{'_session_id'}, $session_id, 'Got session id ' . $session_id );
@@ -58,7 +59,8 @@ $agent->get($url);
 is ($agent->status, 200, "Loaded a page");
 
 RT::Interface::Web::Session::Load(
-    Id => $session_id,
+    Ref => \%session,
+    Id  => $session_id,
 );
 
 is ( $session{'_session_id'}, $session_id, 'Got session id ' . $session_id );
@@ -67,6 +69,7 @@ is ($last_updated, $session{'SelectObject---RT::Queue---' . $user_id . '---Creat
     "lastupdated is still $last_updated");
 
 RT::Interface::Web::Session::Set(
+    Ref   => \%session,
     Key   => 'Testing',
     Value => 'TestValue',
 );
@@ -74,19 +77,22 @@ RT::Interface::Web::Session::Set(
 is ( $session{'Testing'}, 'TestValue', 'Set a test value' );
 
 RT::Interface::Web::Session::Load(
-    Id => $session_id,
+    Ref => \%session,
+    Id  => $session_id,
 );
 
 is ( $session{'Testing'}, 'TestValue', 'Test value still set after Load' );
 
 RT::Interface::Web::Session::Delete(
+    Ref => \%session,
     Key => 'Testing',
 );
 
 ok ( !(exists $session{'Testing'}), 'Test value deleted' );
 
 RT::Interface::Web::Session::Load(
-    Id => $session_id,
+    Ref => \%session,
+    Id  => $session_id,
 );
 
 ok ( !(exists $session{'Testing'}), 'Test value still deleted after Load' );
@@ -105,6 +111,7 @@ my ($session_id2) = $agent->cookie_jar->as_string =~ /RT_SID_[^=]+=(\w+);/;
 ok ( $agent->logout(), 'Logged out' );
 
 RT::Interface::Web::Session::Load(
+    Ref => \%session,
     Id => $session_id2,
 );
 

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list