Bugzilla – Attachment 167276 Details for
Bug 36575
Wrong patron can be returned for API validation route
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36575: Unit tests for checkpw_ldap
Bug-36575-Unit-tests-for-checkpwldap.patch (text/plain), 2.05 KB, created by
Tomás Cohen Arazi
on 2024-05-30 16:54:34 UTC
(
hide
)
Description:
Bug 36575: Unit tests for checkpw_ldap
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2024-05-30 16:54:34 UTC
Size:
2.05 KB
patch
obsolete
>From 3515950bcdecceac839b1e774180b762673c5354 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 30 May 2024 14:51:11 +0000 >Subject: [PATCH] Bug 36575: Unit tests for checkpw_ldap > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Auth_with_ldap.t | 37 ++++++++++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t >index 19e95d24fb5..2b6727100d4 100755 >--- a/t/db_dependent/Auth_with_ldap.t >+++ b/t/db_dependent/Auth_with_ldap.t >@@ -138,7 +138,7 @@ can_ok( > > subtest 'checkpw_ldap tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > ## Connection fail tests > $desired_connection_result = 'error'; >@@ -433,6 +433,41 @@ qr/LDAP Auth rejected : invalid password for user 'hola'./, > > $schema->storage->txn_rollback; > }; >+ >+ subtest "!update && !replica return values" => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ # avoid noise >+ t::lib::Mocks::mock_preference( 'ExtendedPatronAttributes', 0 ); >+ $welcome = 0; >+ >+ # the scenario >+ $replicate = 0; >+ $update = 0; >+ >+ $anonymous_bind = 0; >+ $desired_count_result = 1; >+ $desired_authentication_result = 'success'; >+ $desired_admin_bind_result = 'success'; >+ $desired_search_result = 'success'; >+ $desired_bind_result = 'success'; >+ reload_ldap_module(); >+ >+ my ( $ret_val, $ret_cardnumber, $ret_userid, $ret_patron ) = >+ C4::Auth_with_ldap::checkpw_ldap( $patron->userid, password => 'hey' ); >+ >+ is( $ret_val, 1 ); >+ is( $ret_cardnumber, $patron->cardnumber ); >+ is( $ret_userid, $patron->userid ); >+ is( $ret_patron->id, $patron->id ); >+ >+ $schema->storage->txn_rollback; >+ }; > }; > > subtest 'search_method tests' => sub { >-- >2.45.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 36575
:
164668
|
164670
|
164671
|
165133
|
165134
|
165467
|
165468
|
165469
|
165470
|
165471
|
165908
|
166493
|
166494
|
166495
|
166496
|
166497
|
166498
| 167276 |
167277
|
167278
|
167279
|
167280
|
167281
|
167282
|
167283