Bugzilla – Attachment 63394 Details for
Bug 18579
Problem with :Filter::MARC::EmbedItemsAvailability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 18579: Regression tests
SIGNED-OFF-Bug-18579-Regression-tests.patch (text/plain), 2.06 KB, created by
Katrin Fischer
on 2017-05-12 05:30:45 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 18579: Regression tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2017-05-12 05:30:45 UTC
Size:
2.06 KB
patch
obsolete
>From be33cb2d067132fd9ddf70763b2d2f85bc24933c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 11 May 2017 13:04:18 -0300 >Subject: [PATCH] [SIGNED OFF] Bug 18579: Regression tests > >This patch makes sure the tests have the biblio.biblionumber mapping mocked >so we test the case where the mapping is to a control field instead of just >regular data fields (in the case of UNIMARC). > >To test: >- Apply the patch >- Run: > $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >=> FAIL: Tests fail due to an attemp to access a subfield on a control field. > >Sponsored-by: ByWater Solutions > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Filter/EmbedItemsAvailability.t | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >index 7110bf9..74a8d03e 100755 >--- a/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >+++ b/t/db_dependent/Koha/Filter/EmbedItemsAvailability.t >@@ -18,6 +18,8 @@ > use Modern::Perl; > > use Test::More tests => 1; >+use Test::MockModule; >+ > use t::lib::Mocks; > use t::lib::TestBuilder; > >@@ -36,8 +38,26 @@ subtest 'EmbedItemsAvailability tests' => sub { > > $schema->storage->txn_begin(); > >+ my $biblio = Test::MockModule->new('C4::Biblio'); >+ $biblio->mock( 'GetMarcFromKohaField', sub { >+ my ( $kohafield, $frameworkcode ) = @_; >+ if ( $kohafield eq 'biblio.biblionumber' ) { >+ if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { >+ return ( '001', '@' ); >+ } >+ else { >+ return ( '999', 'c' ); >+ } >+ } >+ else { >+ my $func_ref = $biblio->original( 'GetMarcFromKohaField' ); >+ &$func_ref( $kohafield, $frameworkcode ); >+ } >+ }); >+ > # MARC21 tests > t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); >+ > # Create a dummy record > my ( $biblionumber, $biblioitemnumber ) = AddBiblio(MARC::Record->new(), ''); > >-- >2.7.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 18579
:
63389
|
63390
|
63394
|
63395
|
63396
|
63397
|
63414
|
63415