Bugzilla – Attachment 157403 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.21 KB, created by
Martin Renvoize
on 2023-10-19 09:33:12 UTC
(
hide
)
Description:
Bug 34014: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-10-19 09:33:12 UTC
Size:
2.21 KB
patch
obsolete
>From 4bcaeee45e05ba357fc87764a0d383e3e5fc8bf3 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 > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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 8cf358d4124..4f096f7fe1c 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.41.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 34014
:
152360
|
157274
|
157275
|
157276
|
157277
|
157280
|
157401
|
157402
| 157403 |
157404
|
157405