Bugzilla – Attachment 194412 Details for
Bug 41982
Linked items resulting from EasyAnalyticalRecords are not shown on OPAC results page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41982: Unit tests
Bug-41982-Unit-tests.patch (text/plain), 2.44 KB, created by
Janusz Kaczmarek
on 2026-03-03 20:26:25 UTC
(
hide
)
Description:
Bug 41982: Unit tests
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2026-03-03 20:26:25 UTC
Size:
2.44 KB
patch
obsolete
>From 41ef209a831e9c8dd7cd64ba3760ba9fcdeb05a5 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 3 Mar 2026 20:00:57 +0000 >Subject: [PATCH] Bug 41982: Unit tests > >Caveat, errors from QA script about 'http://' are misleading. >--- > t/db_dependent/XSLT.t | 50 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 49 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 1ce78b12ae..a7e59e8653 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -21,7 +21,7 @@ use File::Temp; > use File::Path qw/make_path/; > use MARC::Record; > use Test::NoWarnings; >-use Test::More tests => 5; >+use Test::More tests => 6; > use Test::Warn; > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -308,3 +308,51 @@ subtest 'buildKohaItemsNamespace() including/omitting items tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'buildKohaItemsNamespace() EasyAnalyticalRecords items' => sub { >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); >+ >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $library_name = $library->branchname; >+ >+ my $biblio1 = $builder->build_sample_biblio; >+ my $biblio2 = $builder->build_sample_biblio; >+ >+ my $item_1 = $builder->build_sample_item( { biblionumber => $biblio1->biblionumber, library => $library->id } ); >+ >+ my $marc2 = $biblio2->metadata->record; >+ $marc2->insert_fields_ordered( >+ MARC::Field->new( >+ '773', '0', ' ', >+ 0 => $biblio1->biblionumber, >+ 9 => $item_1->itemnumber >+ ) >+ ); >+ C4::Biblio::ModBiblio( $marc2, $biblio2->biblionumber, '' ); >+ >+ t::lib::Mocks::mock_preference( 'EasyAnalyticalRecords', '0' ); >+ my $xml = C4::XSLT::buildKohaItemsNamespace( $biblio2->biblionumber, undef, undef ); >+ is( >+ $xml, '<items xmlns="http://www.koha-community.org/items"></items>', >+ 'Empty XML' >+ ); >+ >+ t::lib::Mocks::mock_preference( 'EasyAnalyticalRecords', '1' ); >+ $xml = C4::XSLT::buildKohaItemsNamespace( $biblio2->biblionumber, undef, undef ); >+ isnt( >+ $xml, >+ '<items xmlns="http://www.koha-community.org/items"></items>', >+ 'Items present' >+ ); >+ like( >+ $xml, >+ qr{<homebranch>$library_name</homebranch>}, >+ '$item_1 present in the XML' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >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 41982
:
194411
| 194412