Bugzilla – Attachment 41127 Details for
Bug 14456
EmbedSeeFromHeadings record filter shouldn't process MARC holding fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
SIGNED-OFF-Bug-14456-regression-test-Holdings-fiel.patch (text/plain), 2.95 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-07-22 14:28:44 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 14456: (regression test) Holdings fields should be skipped by EmbedSeeFromHeadings
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-07-22 14:28:44 UTC
Size:
2.95 KB
patch
obsolete
>From aa9f8bea006517c13a092f82001bc8201828aa6a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 22 Jul 2015 11:22:20 -0300 >Subject: [PATCH] [SIGNED OFF] Bug 14456: (regression test) Holdings fields > should be skipped by EmbedSeeFromHeadings > >This patch introduces a regression test for the situation in which >an itemnumber on a record matches the authid of an authority record >and the current implementation of the EmbedSeeFromHeadings filter >wrongly includes new holding fields with authority data... > >To test: >- Apply the patch >- Run: > $ prove t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t >=> FAIL: The test 'Holdings fields not processed to introduce See-from heading' > fails. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../RecordProcessor_EmbedSeeFromHeadings.t | 48 ++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > >diff --git a/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t b/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t >index 0c63771..0b9d5f0 100755 >--- a/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t >+++ b/t/db_dependent/RecordProcessor_EmbedSeeFromHeadings.t >@@ -25,6 +25,7 @@ use Koha::Authority; > > use Test::More; > use Test::MockModule; >+use Test::MockObject; > > BEGIN { > use_ok('Koha::RecordProcessor'); >@@ -63,4 +64,51 @@ my $result = $processor->process($bib); > > is_deeply($result, $resultbib, 'Inserted see-from heading to record'); > >+ >+subtest "EmbedSeeFromHeadings should skip holdings fields" => sub { >+ >+ plan tests => 1; >+ >+ my $biblio_record = MARC::Record->new; >+ $biblio_record->add_fields( >+ [ '245', '0', '4', a => 'The Ifrane cookbook' ], >+ [ '952', ' ', ' ', a => 'Cooking', 9 => '1234' ] >+ ); >+ >+ my $record_copy = MARC::Record->new; >+ $record_copy->add_fields( >+ [ '245', '0', '4', a => 'The Ifrane cookbook' ], >+ [ '952', ' ', ' ', a => 'Cooking', 9 => '1234' ] >+ ); >+ >+ >+ my $koha_authority = new Test::MockModule('Koha::Authority'); >+ $koha_authority->mock( 'get_from_authid', sub { >+ >+ my $auth_record = MARC::Record->new; >+ >+ $auth_record->add_fields( >+ [ '001', '1234' ], >+ [ '150', ' ', ' ', a => 'Cooking' ], >+ [ '450', ' ', ' ', a => 'Cookery' ], >+ ); >+ >+ my $authority_object = Test::MockObject->new(); >+ $authority_object->mock( 'authid', sub { return '1234'; }); >+ $authority_object->mock( 'authtype', sub { return 'TOPIC_TERM'; }); >+ $authority_object->mock( 'schema', sub { return 'marc21'; }); >+ $authority_object->mock( 'record', sub { return $auth_record; }); >+ >+ return $authority_object; >+ }); >+ >+ my $processor = Koha::RecordProcessor->new({ >+ filters => ( 'EmbedSeeFromHeadings' ) >+ }); >+ >+ my $result = $processor->process($biblio_record); >+ >+ is_deeply($result, $record_copy, 'Holdings fields not processed to introduce See-from heading'); >+}; >+ > done_testing(); >-- >2.4.6
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 14456
:
40596
|
41127
|
41128
|
41141
|
41142