Bugzilla – Attachment 59328 Details for
Bug 17913
Merge three authority merge fixes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17913: Adjust merge test for AuthorityMergeMode
Bug-17913-Adjust-merge-test-for-AuthorityMergeMode.patch (text/plain), 2.87 KB, created by
Marcel de Rooy
on 2017-01-20 10:45:48 UTC
(
hide
)
Description:
Bug 17913: Adjust merge test for AuthorityMergeMode
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-01-20 10:45:48 UTC
Size:
2.87 KB
patch
obsolete
>From e8ad855ccfcb3680a001452d6cc89eac9862c2e8 Mon Sep 17 00:00:00 2001 >From: mbeaulieu <mbeaulieu@inlibro.com> >Date: Mon, 18 Aug 2014 10:04:55 -0400 >Subject: [PATCH] Bug 17913: Adjust merge test for AuthorityMergeMode >Content-Type: text/plain; charset=utf-8 > >Original fix from a patch on bug 11315. >Amended by Marcel de Rooy January 2017. > >Test plan: >Run t/db_dependent/Authorities/Merge.t in both loose and strict mode. >Should no longer make a difference. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Authorities/Merge.t | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Authorities/Merge.t b/t/db_dependent/Authorities/Merge.t >index 17656b1..54e73a5 100755 >--- a/t/db_dependent/Authorities/Merge.t >+++ b/t/db_dependent/Authorities/Merge.t >@@ -10,6 +10,7 @@ use MARC::Record; > use Test::MockModule; > use Test::MockObject; > >+use t::lib::Mocks; > use t::lib::TestBuilder; > > use C4::Biblio; >@@ -83,7 +84,7 @@ subtest 'Test merge A1 to A2 (within same authtype)' => sub { > > subtest 'Test merge A1 to modified A1' => sub { > # Tests originate from bug 11700 >- plan tests => 8; >+ plan tests => 9; > > # Simulate modifying an authority from auth1old to auth1new > my $auth1old = MARC::Record->new; >@@ -105,6 +106,7 @@ subtest 'Test merge A1 to modified A1' => sub { > # Time to merge > @zebrarecords = ( $MARC1, $MARC2 ); > $index = 0; >+ t::lib::Mocks::mock_preference('AuthorityMergeMode', 'loose'); > my $rv = C4::AuthoritiesMarc::merge( $authid1, $auth1old, $authid1, $auth1new ); > is( $rv, 2, 'Both records are updated now' ); > >@@ -119,10 +121,18 @@ subtest 'Test merge A1 to modified A1' => sub { > compare_field_count( $MARC2, $biblio2, 1 ); > compare_field_order( $MARC2, $biblio2, 1 ); > is( $auth1new->field(109)->subfield('a'), $biblio2->field(109)->subfield('a'), 'Record2 values updated correctly' ); >+ # This is only true in loose mode: >+ is( $biblio1->field(109)->subfield('b'), $MARC1->field(109)->subfield('b'), 'Subfield not overwritten in loose mode'); > >- # TODO Following test will change when we improve merge >- # Will depend on a preference >- is( $biblio1->field(109)->subfield('b'), $MARC1->field(109)->subfield('b'), 'Record not overwritten while merging'); >+ # Merge again in strict mode >+ t::lib::Mocks::mock_preference('AuthorityMergeMode', 'strict'); >+ ModBiblio( $MARC1, $biblionumber1, '' ); >+ @zebrarecords = ( $MARC1 ); >+ $index = 0; >+ $rv = C4::AuthoritiesMarc::merge( $authid1, $auth1old, $authid1, $auth1new ); >+ $biblio1 = GetMarcBiblio($biblionumber1); >+ is( $biblio1->field(109)->subfield('b'), undef, 'Subfield overwritten in strict mode' ); >+ t::lib::Mocks::mock_preference('AuthorityMergeMode', 'loose'); > }; > > subtest 'Test merge A1 to B1 (changing authtype)' => sub { >-- >2.1.4
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 17913
:
59009
|
59010
|
59016
|
59017
|
59065
|
59066
|
59073
|
59078
|
59079
|
59080
|
59081
|
59082
|
59083
|
59084
|
59085
|
59089
|
59090
|
59102
|
59103
|
59104
|
59105
|
59106
|
59107
|
59108
|
59109
|
59110
|
59325
|
59326
|
59327
|
59328
|
59329
|
59330
|
59331
|
59332
|
59333
|
59352
|
59358
|
59360
|
59361
|
59362
|
59363
|
59364
|
59365
|
59366
|
59367
|
59368
|
59369
|
59370
|
59411
|
59412
|
59413
|
60042
|
60043
|
60341
|
60342