Bugzilla – Attachment 123501 Details for
Bug 26302
OPAC XSLT Results: List variable number of itemcallnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26302: Changes for substatus, resultbranch in XSLT.t
Bug-26302-Changes-for-substatus-resultbranch-in-XS.patch (text/plain), 4.62 KB, created by
Marcel de Rooy
on 2021-08-05 14:20:52 UTC
(
hide
)
Description:
Bug 26302: Changes for substatus, resultbranch in XSLT.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-08-05 14:20:52 UTC
Size:
4.62 KB
patch
obsolete
>From 6370507ea82824bc42bb6a07442f48e03711236b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 5 Aug 2021 12:24:31 +0000 >Subject: [PATCH] Bug 26302: Changes for substatus, resultbranch in XSLT.t >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/XSLT.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/XSLT.t | 29 ++++++++++++++++++----------- > 1 file changed, 18 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 521578947b..d7f41c81a8 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -23,6 +23,8 @@ use Test::Warn; > use t::lib::TestBuilder; > use t::lib::Mocks; > >+use Koha::Database; >+use Koha::Libraries; > use Koha::ItemTypes; > > BEGIN { >@@ -46,13 +48,17 @@ subtest 'transformMARCXML4XSLT tests' => sub { > }; > > subtest 'buildKohaItemsNamespace status tests' => sub { >- plan tests => 14; >+ plan tests => 16; > > t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2'); >+ t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' ); >+ t::lib::Mocks::mock_preference( 'resultsMaxItems', '2' ); > > my $itype = $builder->build_object({ class => 'Koha::ItemTypes' }); > my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' }); >- my $item = $builder->build_sample_item({ itype => $itype->itemtype }); >+ my $holdinglibrary = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $item = $builder->build_sample_item({ itype => $itype->itemtype }); >+ $item->holdingbranch( $holdinglibrary->branchcode )->store; > $item->biblioitem->itemtype($itemtype->itemtype)->store; > > my $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >@@ -93,19 +99,20 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > > $item->onloan('2001-01-01')->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Checked out</status>},"Checked out status takes precedence over Not for loan"); >+ like( $xml, qr/<status>other<\/status>/, "Checked out is part of other statuses" ); >+ like($xml,qr{<substatus>Checked out</substatus>},"Checked out status takes precedence over Not for loan"); > > $item->withdrawn(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Withdrawn</status>},"Withdrawn status takes precedence over Checked out"); >+ like($xml,qr{<substatus>Withdrawn</substatus>},"Withdrawn status takes precedence over Checked out"); > > $item->itemlost(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Lost</status>},"Lost status takes precedence over Withdrawn"); >+ like($xml,qr{<substatus>Lost</substatus>},"Lost status takes precedence over Withdrawn"); > > $item->damaged(1)->store; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Damaged</status>},"Damaged status takes precedence over Lost"); >+ like($xml,qr{<substatus>Damaged</substatus>},"Damaged status takes precedence over Lost"); > > $builder->build({ source => "Branchtransfer", value => { > itemnumber => $item->itemnumber, >@@ -114,7 +121,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>In transit</status>},"In-transit status takes precedence over Damaged"); >+ like($xml,qr{<substatus>In transit</substatus>},"In-transit status takes precedence over Damaged"); > > my $hold = $builder->build_object({ class => 'Koha::Holds', value => { > biblionumber => $item->biblionumber, >@@ -124,16 +131,16 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Waiting</status>},"Waiting status takes precedence over In transit"); >+ like($xml,qr{<substatus>Waiting</substatus>},"Waiting status takes precedence over In transit"); > > $builder->build({ source => "TmpHoldsqueue", value => { > itemnumber => $item->itemnumber > } > }); > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); >- like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all"); >- >- >+ like($xml,qr{<substatus>Pending hold</substatus>},"Pending status takes precedence over all"); >+ my $library_name = $holdinglibrary->branchname; >+ like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" ); > }; > > $schema->storage->txn_rollback; >-- >2.20.1
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 26302
:
109184
|
119108
|
119109
|
119110
|
119111
|
122386
|
122387
|
122388
|
122389
|
122391
|
122462
|
122463
|
122464
|
122465
|
122466
|
122487
|
123499
|
123500
|
123501
|
123502
|
123526
|
123527
|
123528
|
123529
|
123531
|
123532
|
123533
|
123534
|
123640
|
123641
|
123643
|
123644
|
123645
|
123646
|
123647
|
123648
|
123649
|
124243
|
124244
|
124245