Bugzilla – Attachment 172427 Details for
Bug 38100
Items with damaged status are shown in OPAC results as "Not available" even with AllowHoldsOnDamagedItems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38100: Unit tests
Bug-38100-Unit-tests.patch (text/plain), 2.13 KB, created by
Janusz Kaczmarek
on 2024-10-04 19:41:00 UTC
(
hide
)
Description:
Bug 38100: Unit tests
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-10-04 19:41:00 UTC
Size:
2.13 KB
patch
obsolete
>From e5f1eef41a25d336a32eaaafe01f5d4041442ae0 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Fri, 4 Oct 2024 19:18:16 +0000 >Subject: [PATCH] Bug 38100: Unit tests > >--- > t/db_dependent/XSLT.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 5f79b35b13..4f7ef3c84b 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -82,12 +82,13 @@ subtest 'Tests moved from t' => sub { > }; > > subtest 'buildKohaItemsNamespace status tests' => sub { >- plan tests => 18; >+ plan tests => 20; > $schema->storage->txn_begin; > > t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2'); > t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' ); > t::lib::Mocks::mock_preference( 'OPACResultsMaxItems', '2' ); >+ t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', '0' ); > > my $itype = $builder->build_object({ class => 'Koha::ItemTypes' }); > my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); >@@ -152,6 +153,17 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); > like($xml,qr{<substatus>Damaged</substatus>},"Damaged status takes precedence over Lost"); > >+ my $item2 = $builder->build_sample_item( { itype => $itype->itemtype } ); >+ $item2->holdingbranch( $holdinglibrary->branchcode )->store; >+ $item2->biblioitem->itemtype( $itemtype->itemtype )->store; >+ $item2->damaged(1)->store; >+ >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item2->biblionumber, [] ); >+ like( $xml, qr{<status>other</status>}, "Damaged status with AllowHoldsOnDamagedItems = 0 results in 'other'" ); >+ t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', '1' ); >+ $xml = C4::XSLT::buildKohaItemsNamespace( $item2->biblionumber, [] ); >+ like( $xml, qr{<status>available</status>}, "Damaged status with AllowHoldsOnDamagedItems results in 'available'" ); >+ > $builder->build({ source => "Branchtransfer", value => { > itemnumber => $item->itemnumber, > datearrived => undef, >-- >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 38100
:
172426
|
172427
|
172429
|
172430
|
174112
|
174113
|
174114