From eec55cf57a5f25f0161126db7aa8bbe9c8564a13 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 4 Mar 2024 10:20:05 -0300 Subject: [PATCH] Bug 36084: Fix cookie domain for www/ tests This patch changes the hardcoded `koha.local` value on t::lib::Mocks::Zebra so tests don't fail when the domain is not `koha`. To test: 1. Run: $ ktd --shell k$ export KOHA_INTRANET_URL=http://kohadev-intra.myDNSname.org:8081 k$ prove t/db_dependent/www/batch.t => FAIL: Tests fail! 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- t/lib/Mocks/Zebra.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib/Mocks/Zebra.pm b/t/lib/Mocks/Zebra.pm index a82750a2de4..ef27d36ec72 100644 --- a/t/lib/Mocks/Zebra.pm +++ b/t/lib/Mocks/Zebra.pm @@ -142,7 +142,7 @@ sub load_records_ui { $agent->follow_link_ok( { text => 'Stage records for import' }, 'go to stage MARC' ); - my $session_id = $agent->cookie_jar->get_cookies('koha.local')->{CGISESSID}; + my $session_id = $agent->cookie_jar->get_cookies( $self->{intranet} )->{CGISESSID}; my $csrf_token = Koha::Token->new->generate_csrf({session_id => $session_id}); $agent->post( "$cgi_root/tools/upload-file.pl?temp=1", -- 2.44.0