From 41100322f8423be05e29909dbd4c71c00cb59ab6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 26 Jan 2024 08:57:03 +0100 Subject: [PATCH] Bug 35918: Add test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Magnus Enger Signed-off-by: Kyle M Hall (cherry picked from commit e00cfb3c7b3954e545ad4b363bff48a8f4345d0a) Signed-off-by: Fridolin Somers (cherry picked from commit 7073d114577105537d448c49430eb546c0b435a2) Signed-off-by: Frédéric Demians --- t/db_dependent/Auth.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index 5da1f8b175..60a20e0d1b 100755 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -1309,7 +1309,7 @@ subtest 'checkpw() return values tests' => sub { subtest 'AutoLocation' => sub { - plan tests => 5; + plan tests => 6; $schema->storage->txn_begin; @@ -1356,6 +1356,13 @@ subtest 'AutoLocation' => sub { is( $userid, $patron->userid ); is( $template, undef ); + my $other_library = $builder->build_object( { class => 'Koha::Libraries', value => { branchip => '127.0.0.1' } } ); + $patron->library->branchip('127.0.0.1')->store; + ( $userid, $cookie, $sessionID, $flags, $template ) = + C4::Auth::checkauth( $cgi, 0, { catalogue => 1 }, 'intranet' ); + my $session = C4::Auth::get_session($sessionID); + is( $session->param('branch'), $patron->branchcode ); + $schema->storage->txn_rollback; }; -- 2.39.5