Bugzilla – Attachment 162142 Details for
Bug 36092
sessionID not passed to the template on auth.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36092: Add test
Bug-36092-Add-test.patch (text/plain), 2.07 KB, created by
Jonathan Druart
on 2024-02-14 11:27:36 UTC
(
hide
)
Description:
Bug 36092: Add test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-02-14 11:27:36 UTC
Size:
2.07 KB
patch
obsolete
>From 180476af1906f7e143607fbd0852b336dec3f0a2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Feb 2024 10:56:17 +0100 >Subject: [PATCH] Bug 36092: Add test > >--- > t/db_dependent/Auth.t | 30 +++++++++++++++++++++++++++--- > 1 file changed, 27 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index dace642faf9..61b1ecca8a9 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -42,7 +42,7 @@ $schema->storage->txn_begin; > > subtest 'checkauth() tests' => sub { > >- plan tests => 9; >+ plan tests => 10; > > my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); > >@@ -110,11 +110,35 @@ subtest 'checkauth() tests' => sub { > is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); > }; > >- subtest 'Template params tests (password_expired)' => sub { >+ subtest 'sessionID should be passed to the template for auth' => sub { > > plan tests => 1; > >- my $password_expired; >+ subtest 'hit auth.tt' => sub { >+ >+ plan tests => 1; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 0 } } ); >+ >+ my $password = set_weak_password($patron); >+ >+ my $cgi_mock = Test::MockModule->new('CGI'); >+ $cgi_mock->mock( 'request_method', sub { return 'POST' } ); >+ my $cgi = CGI->new; >+ >+ # Simulating the login form submission >+ $cgi->param( 'userid', $patron->userid ); >+ $cgi->param( 'password', $password ); >+ >+ my ( $userid, $cookie, $sessionID, $flags, $template ) = >+ C4::Auth::checkauth( $cgi, 0, { catalogue => 1 }, 'intranet', undef, undef, { do_not_print => 1 } ); >+ ok( $template->{VARS}->{sessionID} ); >+ }; >+ }; >+ >+ subtest 'Template params tests (password_expired)' => sub { >+ >+ plan tests => 1; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36092
:
162139
|
162140
|
162141
|
162142
|
162143
|
162144
|
162158
|
162160
|
162161
|
162189
|
162190
|
162191