Bugzilla – Attachment 173903 Details for
Bug 36822
When creating a new patron via LDAP or Shibboleth 0000-00-00 is inserted for invalid updated_on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36822: Shibboleth - Add tests
Bug-36822-Shibboleth---Add-tests.patch (text/plain), 2.55 KB, created by
Pedro Amorim
on 2024-11-04 11:34:40 UTC
(
hide
)
Description:
Bug 36822: Shibboleth - Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-04 11:34:40 UTC
Size:
2.55 KB
patch
obsolete
>From 716caec31884fba315a559c88eddcf6b35744bcf Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 25 Oct 2024 14:35:39 +0000 >Subject: [PATCH] Bug 36822: Shibboleth - Add tests > >prove t/db_dependent/Auth_with_shibboleth.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Auth_with_shibboleth.t | 35 +++++++++++++++++++++++++-- > 1 file changed, 33 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Auth_with_shibboleth.t b/t/db_dependent/Auth_with_shibboleth.t >index 440eef2a1f..5f1d8be0cd 100755 >--- a/t/db_dependent/Auth_with_shibboleth.t >+++ b/t/db_dependent/Auth_with_shibboleth.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 5; >+use Test::More tests => 6; > use Test::MockModule; > use Test::Warn; > use CGI qw(-utf8 ); >@@ -32,6 +32,14 @@ use t::lib::TestBuilder; > > use C4::Auth_with_shibboleth qw( shib_ok login_shib_url get_login_shib checkpw_shib ); > use Koha::Database; >+use Koha::DateUtils qw( dt_from_string ); >+ >+BEGIN { >+ use_ok( >+ 'C4::Auth', >+ qw( checkpw ) >+ ); >+} > > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >@@ -156,7 +164,7 @@ subtest "get_login_shib tests" => sub { > > subtest "checkpw_shib tests" => sub { > >- plan tests => 52; >+ plan tests => 54; > > # Test borrower data > my $test_borrowers = [ >@@ -288,6 +296,29 @@ subtest "checkpw_shib tests" => sub { > is( $retuserid, undef ); > is( $retpatron, undef ); > $logger->info_is("No users with userid of martin found and autocreate is disabled", "Missing matchpoint warned to info"); >+ >+ # autocreate user from checkpw >+ change_config( { autocreate => 1, welcome => 1 } ); >+ $shib_login = 'test43210'; >+ $ENV{'uid'} = 'test43210'; >+ $ENV{'sn'} = "pika"; >+ $ENV{'exp'} = "2017-01-01"; >+ $ENV{'cat'} = $category->categorycode; >+ $ENV{'add'} = 'Address'; >+ $ENV{'city'} = 'City'; >+ $ENV{'emailpro'} = 'me@myemail.com'; >+ $ENV{branchcode} = $library->branchcode; # needed since T::D::C does no longer hides the FK constraint >+ >+ checkpw($shib_login); >+ ok my $new_user_autocreated = $schema->resultset('Borrower')->search( { 'userid' => 'test43210' }, { rows => 1 } ), >+ "new user found"; >+ >+ my $rec_autocreated = $new_user_autocreated->next; >+ is_deeply( >+ [ map { $rec_autocreated->$_ } qw/updated_on/ ], >+ [ dt_from_string()->ymd . ' ' . dt_from_string()->hms ], >+ 'updated_on correctly saved on newly created user' >+ ); > }; > > subtest 'get_uri' => sub { >-- >2.39.5
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 36822
:
173373
|
173374
|
173375
|
173376
|
173377
|
173385
|
173386
|
173387
|
173388
|
173389
|
173391
|
173392
|
173393
|
173394
|
173395
|
173402
|
173403
|
173404
|
173405
|
173406
|
173646
| 173903 |
173904
|
173905
|
173906
|
173907
|
173908
|
173909
|
174523
|
174525