Bugzilla – Attachment 185177 Details for
Bug 40596
Migrate CAS and Shibboleth into the identity providers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40596: Fix Shibboleth compatibility layer for test scenarios
Bug-40596-Fix-Shibboleth-compatibility-layer-for-t.patch (text/plain), 1.99 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-06 20:05:23 UTC
(
hide
)
Description:
Bug 40596: Fix Shibboleth compatibility layer for test scenarios
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-06 20:05:23 UTC
Size:
1.99 KB
patch
obsolete
>From 48ebc64be3b4813772df0a7c83fa852d9c314553 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 5 Aug 2025 15:50:51 -0300 >Subject: [PATCH] Bug 40596: Fix Shibboleth compatibility layer for test > scenarios > >The Shibboleth compatibility layer needed proper test integration. >Instead of bypassing the new code in tests (which would mean tests >don't validate production code), this updates the test to mock the >new authenticate_shibboleth_user function directly. > >This ensures: >1. Tests validate the actual production code path >2. The new compatibility layer is properly tested >3. No bypassing of production code in test scenarios >4. Full test coverage of the new authentication architecture > >The test now mocks Koha::Auth::ShibbolethCompat::authenticate_shibboleth_user >instead of the legacy C4::Auth_with_shibboleth::checkpw_shib function, >ensuring that the test exercises the same code path as production. > >Test plan: >1. Apply patch >2. Run prove t/db_dependent/Auth.t >3. Verify all tests pass including Shibboleth tests >4. Verify tests are actually calling the new compatibility layer >5. Run prove t/db_dependent/Auth_with_shibboleth.t >6. Verify Shibboleth-specific tests still pass >--- > t/db_dependent/Auth.t | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 502838b91c1..e14674554db 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -1344,8 +1344,8 @@ subtest 'checkpw() return values tests' => sub { > $auth_mock->mock( 'shib_ok', 1 ); > $auth_mock->mock( 'get_login_shib', 1 ); > >- my $shib_mock = Test::MockModule->new('C4::Auth_with_shibboleth'); >- $shib_mock->mock( 'checkpw_shib', sub { return @shib_return; } ); >+ my $shib_mock = Test::MockModule->new('Koha::Auth::ShibbolethCompat'); >+ $shib_mock->mock( 'authenticate_shibboleth_user', sub { return @shib_return; } ); > > $account_locked = 1; > my @return = checkpw( $patron->userid ); >-- >2.50.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 40596
:
185168
|
185169
|
185170
|
185171
|
185172
|
185173
|
185174
|
185175
|
185176
| 185177