Bugzilla – Attachment 158383 Details for
Bug 34529
Offline circulation should be able to accept userid as well as cardnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34529: (QA follow-up) Tidy OfflineCirculation.t
Bug-34529-QA-follow-up-Tidy-OfflineCirculationt.patch (text/plain), 5.69 KB, created by
Katrin Fischer
on 2023-11-04 13:11:33 UTC
(
hide
)
Description:
Bug 34529: (QA follow-up) Tidy OfflineCirculation.t
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-11-04 13:11:33 UTC
Size:
5.69 KB
patch
obsolete
>From 5cd50abb484e7111da29636e03e18d256476505e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 3 Nov 2023 10:48:39 +0000 >Subject: [PATCH] Bug 34529: (QA follow-up) Tidy OfflineCirculation.t > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../Circulation/OfflineCirculation.t | 84 +++++++++++-------- > 1 file changed, 47 insertions(+), 37 deletions(-) > >diff --git a/t/db_dependent/Circulation/OfflineCirculation.t b/t/db_dependent/Circulation/OfflineCirculation.t >index 3ec4b81244..9aec60fb19 100755 >--- a/t/db_dependent/Circulation/OfflineCirculation.t >+++ b/t/db_dependent/Circulation/OfflineCirculation.t >@@ -95,14 +95,12 @@ subtest "Bug 34529: Offline circulation should be able to accept userid as well > "ProcessOfflineIssue succeeds with cardnumber" > ); > is( >- ProcessOfflineIssue( >- { cardnumber => $borrower1->{userid}, barcode => $item2->barcode } >- ), >+ ProcessOfflineIssue( { cardnumber => $borrower1->{userid}, barcode => $item2->barcode } ), > "Success.", > "ProcessOfflineIssue succeeds with user id" > ); > >- }; >+}; > > subtest "Bug 30114 - Koha offline circulation will always cancel the next hold when issuing item to a patron" => sub { > >@@ -114,36 +112,45 @@ subtest "Bug 30114 - Koha offline circulation will always cancel the next hold w > t::lib::Mocks::mock_preference( "item-level_itypes", 1 ); > > #Â Create a branch >- $branch = $builder->build({ source => 'Branch' })->{ branchcode }; >+ $branch = $builder->build( { source => 'Branch' } )->{branchcode}; >+ > #Â Create a borrower >- my $borrower1 = $builder->build({ >- source => 'Borrower', >- value => { branchcode => $branch } >- }); >+ my $borrower1 = $builder->build( >+ { >+ source => 'Borrower', >+ value => { branchcode => $branch } >+ } >+ ); > >- my $borrower2 = $builder->build({ >- source => 'Borrower', >- value => { branchcode => $branch } >- }); >+ my $borrower2 = $builder->build( >+ { >+ source => 'Borrower', >+ value => { branchcode => $branch } >+ } >+ ); > >- my $borrower3 = $builder->build({ >- source => 'Borrower', >- value => { branchcode => $branch } >- }); >+ my $borrower3 = $builder->build( >+ { >+ source => 'Borrower', >+ value => { branchcode => $branch } >+ } >+ ); > > #Â Look for the defined MARC field for biblio-level itemtype >- my $rs = $schema->resultset('MarcSubfieldStructure')->search({ >- frameworkcode => '', >- kohafield => 'biblioitems.itemtype' >- }); >+ my $rs = $schema->resultset('MarcSubfieldStructure')->search( >+ { >+ frameworkcode => '', >+ kohafield => 'biblioitems.itemtype' >+ } >+ ); > my $tagfield = $rs->first->tagfield; > my $tagsubfield = $rs->first->tagsubfield; > > # Create a biblio record with biblio-level itemtype > my $record = MARC::Record->new(); > my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' ); >- my $itype = $builder->build({ source => 'Itemtype' }); >- my $item = $builder->build_sample_item( >+ my $itype = $builder->build( { source => 'Itemtype' } ); >+ my $item = $builder->build_sample_item( > { > biblionumber => $biblionumber, > library => $branch, >@@ -153,37 +160,40 @@ subtest "Bug 30114 - Koha offline circulation will always cancel the next hold w > > AddReserve( > { >- branchcode => $branch, >- borrowernumber => $borrower1->{borrowernumber}, >- biblionumber => $biblionumber, >- priority => 1, >- itemnumber => $item->id, >+ branchcode => $branch, >+ borrowernumber => $borrower1->{borrowernumber}, >+ biblionumber => $biblionumber, >+ priority => 1, >+ itemnumber => $item->id, > } > ); > > AddReserve( > { >- branchcode => $branch, >- borrowernumber => $borrower2->{borrowernumber}, >- biblionumber => $biblionumber, >- priority => 2, >- itemnumber => $item->id, >+ branchcode => $branch, >+ borrowernumber => $borrower2->{borrowernumber}, >+ biblionumber => $biblionumber, >+ priority => 2, >+ itemnumber => $item->id, > } > ); > > my $now = dt_from_string->truncate( to => 'minute' ); >- AddOfflineOperation( $borrower3->{borrowernumber}, $borrower3->{branchcode}, $now, 'issue', $item->barcode, $borrower3->{cardnumber} ); >+ AddOfflineOperation( >+ $borrower3->{borrowernumber}, $borrower3->{branchcode}, $now, 'issue', $item->barcode, >+ $borrower3->{cardnumber} >+ ); > > my $offline_rs = Koha::Database->new()->schema()->resultset('PendingOfflineOperation')->search(); > is( $offline_rs->count, 1, "Found one pending offline operation" ); > >- is( Koha::Holds->search({ biblionumber => $biblionumber })->count, 2, "Found two holds for the record" ); >+ is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Found two holds for the record" ); > > my $op = GetOfflineOperation( $offline_rs->next->id ); > >- my $ret = ProcessOfflineOperation( $op ); >+ my $ret = ProcessOfflineOperation($op); > >- is( Koha::Holds->search({ biblionumber => $biblionumber })->count, 2, "Still found two holds for the record" ); >+ is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" ); > }; > > $schema->storage->txn_rollback; >-- >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 34529
:
154403
|
154411
|
155969
|
155970
|
158140
|
158141
|
158321
|
158322
|
158323
|
158324
|
158380
|
158381
|
158382
| 158383