Bugzilla – Attachment 124222 Details for
Bug 28373
Items fields not used in default XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28373: Unit test
Bug-28373-Unit-test.patch (text/plain), 2.21 KB, created by
Katrin Fischer
on 2021-08-29 11:49:41 UTC
(
hide
)
Description:
Bug 28373: Unit test
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-08-29 11:49:41 UTC
Size:
2.21 KB
patch
obsolete
>From b723c744655086e8cd2e98f5766d246ba1fa4f8b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 6 Jul 2021 12:32:19 +0000 >Subject: [PATCH] Bug 28373: Unit test > >Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/Search.t | 37 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 36 insertions(+), 1 deletion(-) > >diff --git a/t/Search.t b/t/Search.t >index 0959c85de0..64b6e50dc6 100755 >--- a/t/Search.t >+++ b/t/Search.t >@@ -17,14 +17,18 @@ > > use Modern::Perl; > >+use C4::Biblio; > use Test::More; >+use Test::MockModule; >+use Test::Warn; > use t::lib::Mocks; >+use t::lib::TestBuilder; > > use Module::Load::Conditional qw/check_install/; > > BEGIN { > if ( check_install( module => 'Test::DBIx::Class' ) ) { >- plan tests => 3; >+ plan tests => 4; > } else { > plan skip_all => "Need Test::DBIx::Class" > } >@@ -169,4 +173,35 @@ subtest "_build_initial_query tests" => sub { > > }; > >+subtest "searchResults PassItemMarcToXSLT test" => sub { > >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference('OPACXSLTResultsDisplay','default'); >+ t::lib::Mocks::mock_preference('marcflavour','MARC21'); >+ my $mock_xslt = Test::MockModule->new("C4::Search"); >+ $mock_xslt->mock( XSLTParse4Display => sub { >+ my (undef, $record) = @_; >+ warn $record->field('952') ? "Item here" : "No item"; >+ return undef; >+ }); >+ >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $item = $builder->build_sample_item(); >+ my $record = $item->biblio->metadata->record; >+ C4::Biblio::EmbedItemsInMarcBiblio({ marc_record => $record, biblionumber => $item->biblionumber }); >+ >+ t::lib::Mocks::mock_preference('PassItemMarcToXSLT','1'); >+ >+ warnings_like { searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) } >+ [qr/Item here/], >+ "Item field returned from default XSLT if pref set"; >+ >+ t::lib::Mocks::mock_preference('PassItemMarcToXSLT','0'); >+ >+ warnings_like { searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) } >+ [qr/No item/], >+ "Item field returned from default XSLT if pref set"; >+ >+} >-- >2.11.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 28373
:
121115
|
121610
|
121611
|
122614
|
122615
|
122616
|
122628
|
122629
|
122630
|
124019
| 124222 |
124223
|
124224
|
124225
|
124226
|
124254
|
124255
|
124495
|
124496
|
124686