Bugzilla – Attachment 148782 Details for
Bug 32426
Make userid generation pluggable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32426: (follow-up) Fix for Members.t / Patrons.t
Bug-32426-follow-up-Fix-for-Memberst--Patronst.patch (text/plain), 3.40 KB, created by
Marcel de Rooy
on 2023-03-27 14:36:37 UTC
(
hide
)
Description:
Bug 32426: (follow-up) Fix for Members.t / Patrons.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-03-27 14:36:37 UTC
Size:
3.40 KB
patch
obsolete
>From 38c519a22d0129e35b2ada69a19d8f49426335ae Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 27 Mar 2023 14:35:28 +0000 >Subject: [PATCH] Bug 32426: (follow-up) Fix for Members.t / Patrons.t >Content-Type: text/plain; charset=utf-8 > >Moving and adjusting test in Member.t. > >Test plan: >Run both tests. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Patrons.t | 6 +++++- > t/db_dependent/Members.t | 24 +----------------------- > 2 files changed, 6 insertions(+), 24 deletions(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index e22c31f227..afb0dcb461 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1810,7 +1810,7 @@ subtest 'Test Koha::Patrons::merge' => sub { > }; > > subtest '->store' => sub { >- plan tests => 9; >+ plan tests => 11; > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > >@@ -1824,6 +1824,10 @@ subtest '->store' => sub { > # Clear userid and check regeneration > $patron_2->userid(undef)->store; > like( $patron_2->userid, qr/\w+\.\w+/, 'Userid regenerated' ); # old school userid >+ $patron_2->userid('')->store; >+ like( $patron_2->userid, qr/\w+\.\w+/, 'Userid regenerated' ); # old school userid >+ $patron_2->userid(0)->store; >+ like( $patron_2->userid, qr/\w+\.\w+/, 'Userid regenerated' ); # old school userid > > # Test password > t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index 3480d29c1b..7d9852af57 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 54; >+use Test::More tests => 53; > use Test::MockModule; > use Test::Exception; > >@@ -154,28 +154,6 @@ is( $borrower->{debarred}, '2042-01-01', 'Koha::Patron->store should correctly s > is( $borrower->{dateexpiry}, '9999-12-31', 'Koha::Patron->store should correctly set dateexpiry if a valid date is given'); > is( $borrower->{dateenrolled}, '2015-09-06', 'Koha::Patron->store should correctly set dateenrolled if a valid date is given'); > >-subtest 'Koha::Patron->store should not update userid if not true' => sub { >- plan tests => 3; >- >- # TODO Move this to t/db_dependent/Koha/Patrons.t subtest ->store >- >- $data{ cardnumber } = "234567890"; >- $data{userid} = 'a_user_id'; >- $borrowernumber = Koha::Patron->new( \%data )->store->borrowernumber; >- my $patron = Koha::Patrons->find( $borrowernumber ); >- my $borrower = $patron->unblessed; >- >- $patron->set( { firstname => 'Tomas', userid => '' } )->store; >- $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; >- is ( $borrower->{userid}, $data{userid}, 'Koha::Patron->store should not update the userid with an empty string' ); >- $patron->set( { firstname => 'Tomas', userid => 0 } )->store; >- $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; >- is ( $borrower->{userid}, $data{userid}, 'Koha::Patron->store should not update the userid with an 0'); >- $patron->set( { firstname => 'Tomas', userid => undef } )->store; >- $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; >- is ( $borrower->{userid}, $data{userid}, 'Koha::Patron->store should not update the userid with an undefined value'); >-}; >- > #Regression tests for bug 10612 > my $library3 = $builder->build({ > source => 'Branch', >-- >2.30.2
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 32426
:
146947
|
146948
|
146949
|
146950
|
146951
|
146952
|
146953
|
146954
|
147252
|
147253
|
147254
|
147255
|
147704
|
147705
|
147706
|
147707
|
147708
|
147709
|
147710
|
147711
|
147712
|
148203
|
148204
|
148205
|
148206
|
148207
|
148208
|
148209
|
148210
|
148211
| 148782 |
148793