Bugzilla – Attachment 161591 Details for
Bug 28762
Item status shows incorrectly on course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28762: Unit tests for not_for_loan accessor
Bug-28762-Unit-tests-for-notforloan-accessor.patch (text/plain), 2.34 KB, created by
Martin Renvoize (ashimema)
on 2024-01-29 10:47:30 UTC
(
hide
)
Description:
Bug 28762: Unit tests for not_for_loan accessor
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-29 10:47:30 UTC
Size:
2.34 KB
patch
obsolete
>From 19f729ef7d69ad83a9c7470b91b45e22965e0058 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 29 Jan 2024 10:46:07 +0000 >Subject: [PATCH] Bug 28762: Unit tests for not_for_loan accessor > >--- > t/db_dependent/Koha/Item.t | 40 +++++++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 7a21db18f55..a42d51fbd2e 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 31; >+use Test::More tests => 32; > use Test::Exception; > use Test::MockModule; > >@@ -2362,3 +2362,41 @@ subtest 'location_update_trigger() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'not_for_loan() tests' => sub { >+ >+ plan tests => 5; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio; >+ my $biblio_itype = Koha::ItemTypes->find( $biblio->itemtype ); >+ $biblio_itype->notforloan(3)->store(); >+ >+ my $item_itype = $builder->build_object( { class => 'Koha::ItemTypes' } ); >+ $item_itype->notforloan(2)->store(); >+ >+ my $item = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, itype => $item_itype->itemtype } ); >+ $item->notforloan(1)->store(); >+ >+ isnt( $biblio->itemtype, $item_itype->itemtype, "Biblio level itemtype and item level itemtype does not match" ); >+ >+ t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); >+ diag("item-level_itypes: 0"); >+ >+ is( $item->not_for_loan, $item->notforloan, '->not_for_loan returns item specific notforloan value when defined and non-zero'); >+ >+ $item->notforloan(0)->store(); >+ is( $item->not_for_loan, $biblio_itype->notforloan, '->not_for_loan returns biblio level itype notforloan value when item notforloan is 0'); >+ >+ t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); >+ diag("item-level_itypes: 1"); >+ >+ $item->notforloan(1)->store(); >+ is( $item->not_for_loan, $item->notforloan, '->not_for_loan returns item specific notforloan value when defined and non-zero'); >+ >+ $item->notforloan(0)->store(); >+ is( $item->not_for_loan, $item_itype->notforloan, '->not_for_loan returns biblio level itype notforloan value when item notforloan is 0'); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.43.0
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 28762
:
123233
|
123234
|
123236
|
123237
|
124661
|
124666
|
124667
|
124668
|
124744
|
125220
|
125228
|
125229
|
125233
|
161563
|
161564
|
161565
|
161566
|
161567
|
161568
|
161569
|
161570
|
161571
|
161572
|
161573
|
161574
|
161584
|
161585
|
161586
|
161587
|
161588
|
161589
|
161590
|
161591
|
163310
|
163311
|
163312
|
163313
|
163314
|
163315
|
163316
|
163317
|
165843
|
165844
|
165845
|
165846
|
165847
|
165848
|
165849
|
165850
|
169172
|
169273
|
169274
|
169275
|
169276
|
169277
|
169278
|
169279
|
169280
|
169281
|
169311
|
169312
|
169313
|
169314
|
169354
|
169355
|
169356
|
169357
|
169358
|
169359
|
169360
|
169361
|
169362
|
169363
|
169364
|
169365
|
169366
|
169367
|
169393