Bugzilla – Attachment 161151 Details for
Bug 16122
Item record needs to keep local use count
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16122: CanBookBeIssued unit test
Bug-16122-CanBookBeIssued-unit-test.patch (text/plain), 2.14 KB, created by
Lucas Gass (lukeg)
on 2024-01-18 20:00:51 UTC
(
hide
)
Description:
Bug 16122: CanBookBeIssued unit test
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-01-18 20:00:51 UTC
Size:
2.14 KB
patch
obsolete
>From f01bf4b8199edcb96046e5a0b1a36177b74ab3b2 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 18 Jan 2024 19:58:32 +0000 >Subject: [PATCH] Bug 16122: CanBookBeIssued unit test > >--- > C4/Circulation.pm | 2 +- > t/db_dependent/Circulation.t | 8 ++++++-- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index deeb737ee3..2926326b9e 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -836,7 +836,7 @@ sub CanBookBeIssued { > ); > > #increment items.localuse >- my $localuse_count = $item_object->localuse; >+ my $localuse_count = $item_object->localuse || 0; > $localuse_count++; > $item_object->localuse( $localuse_count )->store; > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 35e795f075..9376281512 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2434,7 +2434,7 @@ subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { > }; > > subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { >- plan tests => 11; >+ plan tests => 13; > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron_category_x = $builder->build_object( >@@ -2481,11 +2481,16 @@ subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { > my $issue = AddIssue( $patron_2, $item_2->barcode ); > $item_2->discard_changes; > ok( $item_2->onloan, "Item is checked out" ); >+ is( $item_2->localuse, undef , 'No localuse is recorded.'); > > ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); > $item_2->discard_changes; > ok( !$item_2->onloan, "Checked out item is returned" ); > >+ AddIssue( $patron, $item_2->barcode); >+ $item_2->discard_changes; # refresh >+ is( $item_2->localuse, 1 , 'Localuse is recorded.'); >+ > # TODO There are other tests to provide here > }; > >@@ -6217,7 +6222,6 @@ subtest 'Test CanBookBeIssued param ignore_reserves (Bug 35322)' => sub { > > }; > >- > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $branches = Koha::Libraries->search(); >-- >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 16122
:
149281
|
149282
|
149283
|
149284
|
150231
|
150232
|
150233
|
150234
|
150235
|
150236
|
150623
|
150693
|
153193
|
153196
|
153197
|
153198
|
153199
|
153200
|
158466
|
158467
|
158468
|
158469
|
158470
|
158471
|
161001
|
161002
|
161003
|
161004
|
161005
|
161006
|
161144
|
161145
|
161146
|
161147
|
161148
|
161149
|
161150
|
161151
|
161153
|
161154
|
161155
|
161156
|
161157
|
161158
|
161159
|
161160
|
163072
|
163073
|
163074
|
163075
|
163076
|
163077
|
163243
|
163244
|
163245
|
163246
|
163247
|
163248
|
163296
|
163297
|
163298
|
163299
|
163300
|
163301
|
163302
|
163303
|
165313
|
165314
|
165315
|
165316
|
165317
|
165318
|
165319
|
165320