Bugzilla – Attachment 108055 Details for
Bug 25313
Add optional skip_merge parameter to ModAuthority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25313: Regression tests
Bug-25313-Regression-tests.patch (text/plain), 1.74 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-08-11 12:29:28 UTC
(
hide
)
Description:
Bug 25313: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-08-11 12:29:28 UTC
Size:
1.74 KB
patch
obsolete
>From bc320c259821e9163a0a0f18b5bac81463e26a93 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 11 Aug 2020 09:26:50 -0300 >Subject: [PATCH] Bug 25313: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/AuthoritiesMarc.t | 35 +++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t >index a24d917f50..384a905298 100755 >--- a/t/db_dependent/AuthoritiesMarc.t >+++ b/t/db_dependent/AuthoritiesMarc.t >@@ -5,7 +5,7 @@ > > use Modern::Perl; > >-use Test::More tests => 9; >+use Test::More tests => 10; > use Test::MockModule; > use Test::Warn; > use MARC::Record; >@@ -215,3 +215,36 @@ subtest 'AddAuthority should respect AUTO_INCREMENT (BZ 18104)' => sub { > }; > > $schema->storage->txn_rollback; >+ >+$module->unmock('GetAuthority'); >+ >+subtest 'ModAuthority() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $auth_type = 'GEOGR_NAME'; >+ my $record = MARC::Record->new; >+ $record->add_fields( >+ [ '001', '1' ], >+ [ '151', ' ', ' ', a => 'United States' ] >+ ); >+; >+ my $auth_id = AddAuthority( $record, undef, $auth_type ); >+ >+ my $mocked_authorities_marc = Test::MockModule->new('C4::AuthoritiesMarc'); >+ $mocked_authorities_marc->mock( 'merge', sub { warn 'merge called'; } ); >+ >+ warning_is >+ { ModAuthority( $auth_id, $record, $auth_type ); } >+ 'merge called', >+ 'No param, merge called'; >+ >+ warning_is >+ { ModAuthority( $auth_id, $record, $auth_type, { skip_merge => 1 } ); } >+ undef, >+ 'skip_merge passed, merge not called'; >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.28.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 25313
:
103954
|
104217
| 108055 |
108056
|
108057