Bugzilla – Attachment 120559 Details for
Bug 27577
Autolink bibs after generating the biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27577: Unit test
Bug-27577-Unit-test.patch (text/plain), 1.60 KB, created by
Nick Clemens (kidclamp)
on 2021-05-05 18:34:28 UTC
(
hide
)
Description:
Bug 27577: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-05-05 18:34:28 UTC
Size:
1.60 KB
patch
obsolete
>From 822e6a9bf36ddbd60d0e493b0894a38c0ae7efb9 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 5 May 2021 18:20:05 +0000 >Subject: [PATCH] Bug 27577: Unit test > >--- > t/db_dependent/Biblio.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index 5d59de3de0..feac71d8eb 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -44,7 +44,7 @@ Koha::Caches->get_instance->clear_from_cache( "MarcSubfieldStructure-" ); > my $builder = t::lib::TestBuilder->new; > > subtest 'AddBiblio' => sub { >- plan tests => 4; >+ plan tests => 5; > > my $marcflavour = 'MARC21'; > t::lib::Mocks::mock_preference( 'marcflavour', $marcflavour ); >@@ -67,6 +67,19 @@ subtest 'AddBiblio' => sub { > ); > is( Koha::Biblios->count, $nb_biblios, > 'No biblio should have been added if something went wrong' ); >+ >+ t::lib::Mocks::mock_preference( 'BiblioAddsAuthorities', $marcflavour ); >+ t::lib::Mocks::mock_preference( 'AutoCreateAuthorities', $marcflavour ); >+ >+ my $mock_biblio = Test::MockModule->new("C4::Biblio"); >+ $mock_biblio->mock( BiblioAutoLink => sub { >+ my $record = shift; >+ my $frameworkcode = shift; >+ warn "My biblionumber is ".$record->subfield('999','c')." and my frameworkcode is $frameworkcode"; >+ }); >+ warning_like { $builder->build_sample_biblio(); } >+ qr/My biblionumber is \d+ and my frameworkcode is /, "The biblionumber is correctly passed to BiblioAutoLink"; >+ > }; > > subtest 'GetMarcSubfieldStructureFromKohaField' => sub { >-- >2.11.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 27577
:
116030
|
116851
|
116854
| 120559 |
120560