Bugzilla – Attachment 157276 Details for
Bug 34014
There is no way to fix records with broken MARCXML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34014: Unit test
Bug-34014-Unit-test.patch (text/plain), 2.04 KB, created by
Nick Clemens (kidclamp)
on 2023-10-17 18:14:39 UTC
(
hide
)
Description:
Bug 34014: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-10-17 18:14:39 UTC
Size:
2.04 KB
patch
obsolete
>From e4dc2b10201fe52dd36b48c2c9b32e8908013747 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 17 Oct 2023 18:06:27 +0000 >Subject: [PATCH] Bug 34014: Unit test > >--- > t/db_dependent/Biblio.t | 28 +++++++++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 8cf358d412..4f096f7fe1 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 19; >+use Test::More tests => 20; > use Test::MockModule; > use Test::Warn; > use List::MoreUtils qw( uniq ); >@@ -26,6 +26,7 @@ use MARC::Record; > use t::lib::Mocks qw( mock_preference ); > use t::lib::TestBuilder; > >+use Koha::ActionLogs; > use Koha::Database; > use Koha::Caches; > use Koha::MarcSubfieldStructures; >@@ -996,6 +997,31 @@ subtest 'GetFrameworkCode' => sub { > > }; > >+subtest 'ModBiblio on invalid record' => sub { >+ plan tests => 3; >+ >+ t::lib::Mocks::mock_preference( "CataloguingLog", 1 ); >+ >+ # We create a record with an onvalid control character in the MARC >+ my $record = MARC::Record->new(); >+ my $field = MARC::Field->new( '650', '', '', 'a' => '00aD000015937' ); >+ $record->append_fields($field); >+ >+ my ($biblionumber) = C4::Biblio::AddBiblio( $record, '' ); >+ >+ warning_like { C4::Biblio::ModBiblio( $record, $biblionumber, '' ); } >+ qr/parser error : PCDATA invalid Char value 31/, >+ 'Modding the biblio warns about the encoding issues'; >+ my $action_logs = >+ Koha::ActionLogs->search( { object => $biblionumber, module => 'Cataloguing', action => 'MODIFY' } ); >+ is( $action_logs->count, 1, "Modification of biblio was successful and recorded" ); >+ my $action_log = $action_logs->next; >+ like( >+ $action_log->info, qr/parser error : PCDATA invalid Char value 31/, >+ "Metadata issue successfully logged in action logs" >+ ); >+}; >+ > # Cleanup > Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); > $schema->storage->txn_rollback; >-- >2.30.2
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 34014
:
152360
|
157274
|
157275
|
157276
|
157277
|
157280
|
157401
|
157402
|
157403
|
157404
|
157405