Bugzilla – Attachment 187985 Details for
Bug 36360
Link ILL requests to surviving patron record when patrons are merged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36360: Add tests
Bug-36360-Add-tests.patch (text/plain), 2.41 KB, created by
Pedro Amorim
on 2025-10-16 10:26:50 UTC
(
hide
)
Description:
Bug 36360: Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-16 10:26:50 UTC
Size:
2.41 KB
patch
obsolete
>From b2b37a1e49167f6069b071016d2d60e2ccba145c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 16 Oct 2025 10:22:16 +0000 >Subject: [PATCH] Bug 36360: Add tests > >prove t/db_dependent/Koha/Patrons.t > >Test plan, k-t-d: >1) Enable ILLModule >2) Create an ILL request for patron 'John', visit: ><staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard >3) Type 'John' and pick the only result. Set a type and library. Click 'Create'. >4) Go to patrons search and search for 'jo': ><staff_url>/cgi-bin/koha/members/members-home.pl >5) Tick the checkbox for John and someone else from the list. Click 'Merge selected patrons' from the top toolbar >6) Select the other patron (not John) as the 'patron to keep'. Click Merge patrons. >7) Notice '1 Illrequest was merge' message shows. >8) Visit the ILL list table, visit: ><staff_url>/cgi-bin/koha/ill/ill-requests.pl >9) Notice the ILL request now belongs to the other patron, not John (who no longer exists). >--- > t/db_dependent/Koha/Patrons.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 61fe5299535..90d6416bd7f 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -2112,7 +2112,7 @@ subtest 'BorrowersLog and CardnumberLog tests' => sub { > $schema->storage->txn_rollback; > > subtest 'Test Koha::Patrons::merge' => sub { >- plan tests => 113; >+ plan tests => 118; > > my $schema = Koha::Database->new()->schema(); > >@@ -2300,6 +2300,20 @@ subtest 'Test Koha::Patrons::merge' => sub { > > }; > >+ subtest 'ILL requests' => sub { >+ plan tests => 3; >+ >+ my $keep_patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $merge_patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $ill_request = $builder->build_sample_ill_request( { borrowernumber => $merge_patron->borrowernumber } ); >+ >+ is( $merge_patron->ill_requests->count, 1, 'Patron to be merged has 1 ILL request' ); >+ is( $keep_patron->ill_requests->count, 0, 'Patron to be kept has 0 ILL requests' ); >+ >+ $keep_patron->merge_with( [ $merge_patron->borrowernumber ] ); >+ is( $keep_patron->ill_requests->count, 1, 'Patron to be kept now has 1 ILL request' ); >+ }; >+ > t::lib::Mocks::mock_preference( 'AnonymousPatron', '' ); > $schema->storage->txn_rollback; > }; >-- >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 36360
:
187984
|
187985
|
189922
|
189923